Skip to content

Commit d58decf

Browse files
committed
fix(datasets): add schema arguments to create_dataset
1 parent 96b2bf8 commit d58decf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

langfuse/_client/client.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3250,20 +3250,28 @@ def create_dataset(
32503250
name: str,
32513251
description: Optional[str] = None,
32523252
metadata: Optional[Any] = None,
3253+
input_schema: Optional[Any] = None,
3254+
expected_output_schema: Optional[Any] = None,
32533255
) -> Dataset:
32543256
"""Create a dataset with the given name on Langfuse.
32553257
32563258
Args:
32573259
name: Name of the dataset to create.
32583260
description: Description of the dataset. Defaults to None.
32593261
metadata: Additional metadata. Defaults to None.
3262+
input_schema: JSON Schema for validating dataset item inputs. When set, all new items will be validated against this schema.
3263+
expected_output_schema: JSON Schema for validating dataset item expected outputs. When set, all new items will be validated against this schema.
32603264
32613265
Returns:
32623266
Dataset: The created dataset as returned by the Langfuse API.
32633267
"""
32643268
try:
32653269
body = CreateDatasetRequest(
3266-
name=name, description=description, metadata=metadata
3270+
name=name,
3271+
description=description,
3272+
metadata=metadata,
3273+
inputSchema=input_schema,
3274+
expectedOutputSchema=expected_output_schema,
32673275
)
32683276
langfuse_logger.debug(f"Creating datasets {body}")
32693277

0 commit comments

Comments
 (0)