diff --git a/langfuse/api/dataset_run_items/client.py b/langfuse/api/dataset_run_items/client.py index cbafacc67..aee820da8 100644 --- a/langfuse/api/dataset_run_items/client.py +++ b/langfuse/api/dataset_run_items/client.py @@ -38,6 +38,7 @@ def create( observation_id: typing.Optional[str] = OMIT, trace_id: typing.Optional[str] = OMIT, dataset_version: typing.Optional[dt.datetime] = OMIT, + created_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DatasetRunItem: """ @@ -66,6 +67,9 @@ def create( If provided, the experiment will use dataset items as they existed at or before this timestamp. If not provided, uses the latest version of dataset items. + created_at : typing.Optional[dt.datetime] + Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -98,6 +102,7 @@ def create( observation_id=observation_id, trace_id=trace_id, dataset_version=dataset_version, + created_at=created_at, request_options=request_options, ) return _response.data @@ -185,6 +190,7 @@ async def create( observation_id: typing.Optional[str] = OMIT, trace_id: typing.Optional[str] = OMIT, dataset_version: typing.Optional[dt.datetime] = OMIT, + created_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> DatasetRunItem: """ @@ -213,6 +219,9 @@ async def create( If provided, the experiment will use dataset items as they existed at or before this timestamp. If not provided, uses the latest version of dataset items. + created_at : typing.Optional[dt.datetime] + Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -253,6 +262,7 @@ async def main() -> None: observation_id=observation_id, trace_id=trace_id, dataset_version=dataset_version, + created_at=created_at, request_options=request_options, ) return _response.data diff --git a/langfuse/api/dataset_run_items/raw_client.py b/langfuse/api/dataset_run_items/raw_client.py index 894adbfff..f281b13d2 100644 --- a/langfuse/api/dataset_run_items/raw_client.py +++ b/langfuse/api/dataset_run_items/raw_client.py @@ -35,6 +35,7 @@ def create( observation_id: typing.Optional[str] = OMIT, trace_id: typing.Optional[str] = OMIT, dataset_version: typing.Optional[dt.datetime] = OMIT, + created_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[DatasetRunItem]: """ @@ -63,6 +64,9 @@ def create( If provided, the experiment will use dataset items as they existed at or before this timestamp. If not provided, uses the latest version of dataset items. + created_at : typing.Optional[dt.datetime] + Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -81,6 +85,7 @@ def create( "observationId": observation_id, "traceId": trace_id, "datasetVersion": dataset_version, + "createdAt": created_at, }, request_options=request_options, omit=OMIT, @@ -298,6 +303,7 @@ async def create( observation_id: typing.Optional[str] = OMIT, trace_id: typing.Optional[str] = OMIT, dataset_version: typing.Optional[dt.datetime] = OMIT, + created_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[DatasetRunItem]: """ @@ -326,6 +332,9 @@ async def create( If provided, the experiment will use dataset items as they existed at or before this timestamp. If not provided, uses the latest version of dataset items. + created_at : typing.Optional[dt.datetime] + Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -344,6 +353,7 @@ async def create( "observationId": observation_id, "traceId": trace_id, "datasetVersion": dataset_version, + "createdAt": created_at, }, request_options=request_options, omit=OMIT, diff --git a/langfuse/api/dataset_run_items/types/create_dataset_run_item_request.py b/langfuse/api/dataset_run_items/types/create_dataset_run_item_request.py index 43a586249..169888912 100644 --- a/langfuse/api/dataset_run_items/types/create_dataset_run_item_request.py +++ b/langfuse/api/dataset_run_items/types/create_dataset_run_item_request.py @@ -46,6 +46,13 @@ class CreateDatasetRunItemRequest(UniversalBaseModel): If not provided, uses the latest version of dataset items. """ + created_at: typing_extensions.Annotated[ + typing.Optional[dt.datetime], FieldMetadata(alias="createdAt") + ] = pydantic.Field(default=None) + """ + Optional timestamp to set the createdAt field of the dataset run item. If not provided or null, defaults to current timestamp. + """ + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( extra="allow", frozen=True )