Skip to content

Commit 71448cd

Browse files
committed
Release 0.8.27
1 parent a279f2d commit 71448cd

26 files changed

+624
-559
lines changed

poetry.lock

Lines changed: 130 additions & 269 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "humanloop"
33

44
[tool.poetry]
55
name = "humanloop"
6-
version = "0.8.26"
6+
version = "0.8.27"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 76 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ Controls how the model uses tools. The following options are supported:
306306
<dl>
307307
<dd>
308308

309+
**log_status:** `typing.Optional[LogStatus]` — Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
310+
311+
</dd>
312+
</dl>
313+
314+
<dl>
315+
<dd>
316+
309317
**source_datapoint_id:** `typing.Optional[str]` — Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
310318

311319
</dd>
@@ -609,6 +617,14 @@ Controls how the model uses tools. The following options are supported:
609617
<dl>
610618
<dd>
611619

620+
**log_status:** `typing.Optional[LogStatus]` — Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
621+
622+
</dd>
623+
</dl>
624+
625+
<dl>
626+
<dd>
627+
612628
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
613629

614630
</dd>
@@ -784,6 +800,14 @@ Controls how the model uses tools. The following options are supported:
784800
<dl>
785801
<dd>
786802

803+
**log_status:** `typing.Optional[LogStatus]` — Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
804+
805+
</dd>
806+
</dl>
807+
808+
<dl>
809+
<dd>
810+
787811
**source_datapoint_id:** `typing.Optional[str]` — Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
788812

789813
</dd>
@@ -1050,6 +1074,14 @@ Controls how the model uses tools. The following options are supported:
10501074
<dl>
10511075
<dd>
10521076

1077+
**log_status:** `typing.Optional[LogStatus]` — Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
1078+
1079+
</dd>
1080+
</dl>
1081+
1082+
<dl>
1083+
<dd>
1084+
10531085
**source_datapoint_id:** `typing.Optional[str]` — Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
10541086

10551087
</dd>
@@ -2684,6 +2716,14 @@ client.tools.log(
26842716
<dl>
26852717
<dd>
26862718

2719+
**log_status:** `typing.Optional[LogStatus]` — Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
2720+
2721+
</dd>
2722+
</dl>
2723+
2724+
<dl>
2725+
<dd>
2726+
26872727
**source_datapoint_id:** `typing.Optional[str]` — Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
26882728

26892729
</dd>
@@ -2917,6 +2957,14 @@ client.tools.update(
29172957
<dl>
29182958
<dd>
29192959

2960+
**log_status:** `typing.Optional[LogStatus]` — Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
2961+
2962+
</dd>
2963+
</dl>
2964+
2965+
<dl>
2966+
<dd>
2967+
29202968
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
29212969

29222970
</dd>
@@ -5490,6 +5538,14 @@ client.evaluators.log(
54905538
<dl>
54915539
<dd>
54925540

5541+
**log_status:** `typing.Optional[LogStatus]` — Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
5542+
5543+
</dd>
5544+
</dl>
5545+
5546+
<dl>
5547+
<dd>
5548+
54935549
**source_datapoint_id:** `typing.Optional[str]` — Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
54945550

54955551
</dd>
@@ -6659,7 +6715,7 @@ Log to a Flow.
66596715
You can use query parameters `version_id`, or `environment`, to target
66606716
an existing version of the Flow. Otherwise, the default deployed version will be chosen.
66616717

6662-
If you create the Flow Log with a `trace_status` of `incomplete`, you should later update it to `complete`
6718+
If you create the Flow Log with a `log_status` of `incomplete`, you should later update it to `complete`
66636719
in order to trigger Evaluators.
66646720
</dd>
66656721
</dl>
@@ -6683,7 +6739,6 @@ client = Humanloop(
66836739
api_key="YOUR_API_KEY",
66846740
)
66856741
client.flows.log(
6686-
log_id="medqa_experiment_0001",
66876742
id="fl_6o701g4jmcanPVHxdqD0O",
66886743
flow={
66896744
"attributes": {
@@ -6703,7 +6758,7 @@ client.flows.log(
67036758
"question": "Patient with a history of diabetes and hypertension presents with chest pain and shortness of breath."
67046759
},
67056760
output="The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.",
6706-
trace_status="incomplete",
6761+
log_status="incomplete",
67076762
start_time=datetime.datetime.fromisoformat(
67086763
"2024-07-08 21:40:35+00:00",
67096764
),
@@ -6878,63 +6933,63 @@ client.flows.log(
68786933
<dl>
68796934
<dd>
68806935

6881-
**source_datapoint_id:** `typing.Optional[str]`Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
6936+
**log_status:** `typing.Optional[LogStatus]`Status of the Flow Log. When a Log is updated from `incomplete` to `complete`, it becomes available to Monitoring Evaluators. Flow Logs cannot have an unspecified status: they must start as `incomplete` to allow children to be added. Provide `complete` if you don't intend to add children to the trace.
68826937

68836938
</dd>
68846939
</dl>
68856940

68866941
<dl>
68876942
<dd>
68886943

6889-
**trace_parent_id:** `typing.Optional[str]`The ID of the parent Log to nest this Log under in a Trace.
6944+
**source_datapoint_id:** `typing.Optional[str]`Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
68906945

68916946
</dd>
68926947
</dl>
68936948

68946949
<dl>
68956950
<dd>
68966951

6897-
**user:** `typing.Optional[str]`End-user ID related to the Log.
6952+
**trace_parent_id:** `typing.Optional[str]`The ID of the parent Log to nest this Log under in a Trace.
68986953

68996954
</dd>
69006955
</dl>
69016956

69026957
<dl>
69036958
<dd>
69046959

6905-
**flow_log_request_environment:** `typing.Optional[str]`The name of the Environment the Log is associated to.
6960+
**user:** `typing.Optional[str]`End-user ID related to the Log.
69066961

69076962
</dd>
69086963
</dl>
69096964

69106965
<dl>
69116966
<dd>
69126967

6913-
**save:** `typing.Optional[bool]`Whether the request/response payloads will be stored on Humanloop.
6968+
**flow_log_request_environment:** `typing.Optional[str]`The name of the Environment the Log is associated to.
69146969

69156970
</dd>
69166971
</dl>
69176972

69186973
<dl>
69196974
<dd>
69206975

6921-
**log_id:** `typing.Optional[str]`This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
6976+
**save:** `typing.Optional[bool]`Whether the request/response payloads will be stored on Humanloop.
69226977

69236978
</dd>
69246979
</dl>
69256980

69266981
<dl>
69276982
<dd>
69286983

6929-
**flow:** `typing.Optional[FlowKernelRequestParams]`Flow used to generate the Trace.
6984+
**log_id:** `typing.Optional[str]`This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
69306985

69316986
</dd>
69326987
</dl>
69336988

69346989
<dl>
69356990
<dd>
69366991

6937-
**trace_status:** `typing.Optional[TraceStatus]`Status of the Trace. When a Trace is marked as `complete`, no more Logs can be added to it. Monitoring Evaluators will only run on `complete` Traces. If you do not intend to add more Logs to the Trace after creation, set this to `complete`.
6992+
**flow:** `typing.Optional[FlowKernelRequestParams]`Flow used to generate the Trace.
69386993

69396994
</dd>
69406995
</dl>
@@ -6997,7 +7052,7 @@ client.flows.update_log(
69977052
"question": "Patient with a history of diabetes and normal tension presents with chest pain and shortness of breath."
69987053
},
69997054
output="The patient is likely experiencing a myocardial infarction. Immediate medical attention is required.",
7000-
trace_status="complete",
7055+
log_status="complete",
70017056
)
70027057

70037058
```
@@ -7022,47 +7077,47 @@ client.flows.update_log(
70227077
<dl>
70237078
<dd>
70247079

7025-
**trace_status:** `TraceStatus`Status of the Trace. When a Trace is marked as `complete`, no more Logs can be added to it. Monitoring Evaluators will only run on completed Traces.
7080+
**messages:** `typing.Optional[typing.Sequence[ChatMessageParams]]`List of chat messages that were used as an input to the Flow.
70267081

70277082
</dd>
70287083
</dl>
70297084

70307085
<dl>
70317086
<dd>
70327087

7033-
**messages:** `typing.Optional[typing.Sequence[ChatMessageParams]]`List of chat messages that were used as an input to the Flow.
7088+
**output_message:** `typing.Optional[ChatMessageParams]`The output message returned by this Flow.
70347089

70357090
</dd>
70367091
</dl>
70377092

70387093
<dl>
70397094
<dd>
70407095

7041-
**output_message:** `typing.Optional[ChatMessageParams]` — The output message returned by this Flow.
7096+
**inputs:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — The inputs passed to the Flow Log.
70427097

70437098
</dd>
70447099
</dl>
70457100

70467101
<dl>
70477102
<dd>
70487103

7049-
**inputs:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — The inputs passed to the Flow Log.
7104+
**output:** `typing.Optional[str]` — The output of the Flow Log. Provide None to unset existing `output` value. Provide either this, `output_message` or `error`.
70507105

70517106
</dd>
70527107
</dl>
70537108

70547109
<dl>
70557110
<dd>
70567111

7057-
**output:** `typing.Optional[str]` — The output of the Flow Log. Provide None to unset existing `output` value. Provide either this, `output_message` or `error`.
7112+
**error:** `typing.Optional[str]` — The error message of the Flow Log. Provide None to unset existing `error` value. Provide either this, `output_message` or `output`.
70587113

70597114
</dd>
70607115
</dl>
70617116

70627117
<dl>
70637118
<dd>
70647119

7065-
**error:** `typing.Optional[str]`The error message of the Flow Log. Provide None to unset existing `error` value. Provide either this, `output_message` or `output`.
7120+
**log_status:** `typing.Optional[LogStatus]`Status of the Flow Log. When a Flow Log is updated to `complete`, no more Logs can be added to it. Monitoring Evaluators will only run on `complete` Flow Logs.
70667121

70677122
</dd>
70687123
</dl>
@@ -10151,7 +10206,9 @@ from humanloop import Humanloop
1015110206
client = Humanloop(
1015210207
api_key="YOUR_API_KEY",
1015310208
)
10154-
client.logs.delete()
10209+
client.logs.delete(
10210+
id="prv_Wu6zx1lAWJRqOyL8nWuZk",
10211+
)
1015510212

1015610213
```
1015710214
</dd>

src/humanloop/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
ListTools,
8686
LlmEvaluatorRequest,
8787
LogResponse,
88+
LogStatus,
8889
ModelEndpoints,
8990
ModelProviders,
9091
MonitoringEvaluatorEnvironmentRequest,
@@ -140,7 +141,6 @@
140141
ToolKernelRequest,
141142
ToolLogResponse,
142143
ToolResponse,
143-
TraceStatus,
144144
UpdateDatesetAction,
145145
UpdateEvaluationStatusRequest,
146146
UserResponse,
@@ -486,6 +486,7 @@
486486
"LlmEvaluatorRequestParams",
487487
"LogResponse",
488488
"LogResponseParams",
489+
"LogStatus",
489490
"ModelEndpoints",
490491
"ModelProviders",
491492
"MonitoringEvaluatorEnvironmentRequest",
@@ -597,7 +598,6 @@
597598
"ToolLogResponseParams",
598599
"ToolResponse",
599600
"ToolResponseParams",
600-
"TraceStatus",
601601
"UnprocessableEntityError",
602602
"UpdateDatesetAction",
603603
"UpdateEvaluationStatusRequest",

src/humanloop/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "humanloop",
19-
"X-Fern-SDK-Version": "0.8.25",
19+
"X-Fern-SDK-Version": "0.8.27",
2020
}
2121
headers["X-API-KEY"] = self.api_key
2222
return headers

src/humanloop/evaluators/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import typing
44
from ..core.client_wrapper import SyncClientWrapper
55
import datetime as dt
6+
from ..types.log_status import LogStatus
67
from ..requests.chat_message import ChatMessageParams
78
from .requests.create_evaluator_log_request_judgment import CreateEvaluatorLogRequestJudgmentParams
89
from .requests.create_evaluator_log_request_spec import CreateEvaluatorLogRequestSpecParams
@@ -61,6 +62,7 @@ def log(
6162
inputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
6263
source: typing.Optional[str] = OMIT,
6364
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
65+
log_status: typing.Optional[LogStatus] = OMIT,
6466
source_datapoint_id: typing.Optional[str] = OMIT,
6567
trace_parent_id: typing.Optional[str] = OMIT,
6668
user: typing.Optional[str] = OMIT,
@@ -131,6 +133,9 @@ def log(
131133
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
132134
Any additional metadata to record.
133135
136+
log_status : typing.Optional[LogStatus]
137+
Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
138+
134139
source_datapoint_id : typing.Optional[str]
135140
Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
136141
@@ -201,6 +206,7 @@ def log(
201206
"inputs": inputs,
202207
"source": source,
203208
"metadata": metadata,
209+
"log_status": log_status,
204210
"parent_id": parent_id,
205211
"source_datapoint_id": source_datapoint_id,
206212
"trace_parent_id": trace_parent_id,
@@ -1165,6 +1171,7 @@ async def log(
11651171
inputs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
11661172
source: typing.Optional[str] = OMIT,
11671173
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1174+
log_status: typing.Optional[LogStatus] = OMIT,
11681175
source_datapoint_id: typing.Optional[str] = OMIT,
11691176
trace_parent_id: typing.Optional[str] = OMIT,
11701177
user: typing.Optional[str] = OMIT,
@@ -1235,6 +1242,9 @@ async def log(
12351242
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
12361243
Any additional metadata to record.
12371244
1245+
log_status : typing.Optional[LogStatus]
1246+
Status of a Log. Set to `incomplete` if you intend to update and eventually complete the Log and want the File's monitoring Evaluators to wait until you mark it as `complete`. If log_status is not provided, observability will pick up the Log as soon as possible. Updating this from specified to unspecified is undefined behavior.
1247+
12381248
source_datapoint_id : typing.Optional[str]
12391249
Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
12401250
@@ -1313,6 +1323,7 @@ async def main() -> None:
13131323
"inputs": inputs,
13141324
"source": source,
13151325
"metadata": metadata,
1326+
"log_status": log_status,
13161327
"parent_id": parent_id,
13171328
"source_datapoint_id": source_datapoint_id,
13181329
"trace_parent_id": trace_parent_id,

0 commit comments

Comments
 (0)