Skip to content

Commit ef08bb7

Browse files
langfuse-botlangfuse-bot
andauthored
feat(api): update API spec from langfuse/langfuse b3adfc3 (#1567)
Co-authored-by: langfuse-bot <langfuse-bot@langfuse.com>
1 parent caddeff commit ef08bb7

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

langfuse/api/dataset_run_items/client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def create(
3838
observation_id: typing.Optional[str] = OMIT,
3939
trace_id: typing.Optional[str] = OMIT,
4040
dataset_version: typing.Optional[dt.datetime] = OMIT,
41+
created_at: typing.Optional[dt.datetime] = OMIT,
4142
request_options: typing.Optional[RequestOptions] = None,
4243
) -> DatasetRunItem:
4344
"""
@@ -66,6 +67,9 @@ def create(
6667
If provided, the experiment will use dataset items as they existed at or before this timestamp.
6768
If not provided, uses the latest version of dataset items.
6869
70+
created_at : typing.Optional[dt.datetime]
71+
Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp.
72+
6973
request_options : typing.Optional[RequestOptions]
7074
Request-specific configuration.
7175
@@ -98,6 +102,7 @@ def create(
98102
observation_id=observation_id,
99103
trace_id=trace_id,
100104
dataset_version=dataset_version,
105+
created_at=created_at,
101106
request_options=request_options,
102107
)
103108
return _response.data
@@ -185,6 +190,7 @@ async def create(
185190
observation_id: typing.Optional[str] = OMIT,
186191
trace_id: typing.Optional[str] = OMIT,
187192
dataset_version: typing.Optional[dt.datetime] = OMIT,
193+
created_at: typing.Optional[dt.datetime] = OMIT,
188194
request_options: typing.Optional[RequestOptions] = None,
189195
) -> DatasetRunItem:
190196
"""
@@ -213,6 +219,9 @@ async def create(
213219
If provided, the experiment will use dataset items as they existed at or before this timestamp.
214220
If not provided, uses the latest version of dataset items.
215221
222+
created_at : typing.Optional[dt.datetime]
223+
Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp.
224+
216225
request_options : typing.Optional[RequestOptions]
217226
Request-specific configuration.
218227
@@ -253,6 +262,7 @@ async def main() -> None:
253262
observation_id=observation_id,
254263
trace_id=trace_id,
255264
dataset_version=dataset_version,
265+
created_at=created_at,
256266
request_options=request_options,
257267
)
258268
return _response.data

langfuse/api/dataset_run_items/raw_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def create(
3535
observation_id: typing.Optional[str] = OMIT,
3636
trace_id: typing.Optional[str] = OMIT,
3737
dataset_version: typing.Optional[dt.datetime] = OMIT,
38+
created_at: typing.Optional[dt.datetime] = OMIT,
3839
request_options: typing.Optional[RequestOptions] = None,
3940
) -> HttpResponse[DatasetRunItem]:
4041
"""
@@ -63,6 +64,9 @@ def create(
6364
If provided, the experiment will use dataset items as they existed at or before this timestamp.
6465
If not provided, uses the latest version of dataset items.
6566
67+
created_at : typing.Optional[dt.datetime]
68+
Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp.
69+
6670
request_options : typing.Optional[RequestOptions]
6771
Request-specific configuration.
6872
@@ -81,6 +85,7 @@ def create(
8185
"observationId": observation_id,
8286
"traceId": trace_id,
8387
"datasetVersion": dataset_version,
88+
"createdAt": created_at,
8489
},
8590
request_options=request_options,
8691
omit=OMIT,
@@ -298,6 +303,7 @@ async def create(
298303
observation_id: typing.Optional[str] = OMIT,
299304
trace_id: typing.Optional[str] = OMIT,
300305
dataset_version: typing.Optional[dt.datetime] = OMIT,
306+
created_at: typing.Optional[dt.datetime] = OMIT,
301307
request_options: typing.Optional[RequestOptions] = None,
302308
) -> AsyncHttpResponse[DatasetRunItem]:
303309
"""
@@ -326,6 +332,9 @@ async def create(
326332
If provided, the experiment will use dataset items as they existed at or before this timestamp.
327333
If not provided, uses the latest version of dataset items.
328334
335+
created_at : typing.Optional[dt.datetime]
336+
Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp.
337+
329338
request_options : typing.Optional[RequestOptions]
330339
Request-specific configuration.
331340
@@ -344,6 +353,7 @@ async def create(
344353
"observationId": observation_id,
345354
"traceId": trace_id,
346355
"datasetVersion": dataset_version,
356+
"createdAt": created_at,
347357
},
348358
request_options=request_options,
349359
omit=OMIT,

langfuse/api/dataset_run_items/types/create_dataset_run_item_request.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class CreateDatasetRunItemRequest(UniversalBaseModel):
4646
If not provided, uses the latest version of dataset items.
4747
"""
4848

49+
created_at: typing_extensions.Annotated[
50+
typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")
51+
] = pydantic.Field(default=None)
52+
"""
53+
Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp.
54+
"""
55+
4956
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
5057
extra="allow", frozen=True
5158
)

0 commit comments

Comments
 (0)