Skip to content

Commit

Permalink
change name
Browse files Browse the repository at this point in the history
  • Loading branch information
jakerachleff committed Aug 13, 2024
1 parent b046afd commit 32e7d7a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2529,8 +2529,8 @@ def create_dataset(
*,
description: Optional[str] = None,
data_type: ls_schemas.DataType = ls_schemas.DataType.kv,
inputs_schema_definition: Optional[Dict[str, Any]] = None,
outputs_schema_definition: Optional[Dict[str, Any]] = None,
inputs_schema: Optional[Dict[str, Any]] = None,
outputs_schema: Optional[Dict[str, Any]] = None,
) -> ls_schemas.Dataset:
"""Create a dataset in the LangSmith API.
Expand All @@ -2552,8 +2552,8 @@ def create_dataset(
name=dataset_name,
description=description,
data_type=data_type,
inputs_schema_definition=inputs_schema_definition,
outputs_schema_definition=outputs_schema_definition,
inputs_schema=inputs_schema,
outputs_schema=outputs_schema,
)
response = self.request_with_retries(
"POST",
Expand Down
4 changes: 2 additions & 2 deletions python/langsmith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ class DatasetBase(BaseModel):
name: str
description: Optional[str] = None
data_type: Optional[DataType] = None
inputs_schema_definition: Optional[Dict[str, Any]] = None
outputs_schema_definition: Optional[Dict[str, Any]] = None
inputs_schema: Optional[Dict[str, Any]] = None
outputs_schema: Optional[Dict[str, Any]] = None

class Config:
"""Configuration class for the schema."""
Expand Down
12 changes: 6 additions & 6 deletions python/tests/integration_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ class OutputSchema(BaseModel):
dataset = langchain_client.create_dataset(
dataset_name,
data_type=DataType.kv,
inputs_schema_definition=InputSchema.model_json_schema(),
outputs_schema_definition=OutputSchema.model_json_schema(),
inputs_schema=InputSchema.model_json_schema(),
outputs_schema=OutputSchema.model_json_schema(),
)

# confirm we store the schema from the create request
assert dataset.inputs_schema_definition == InputSchema.model_json_schema()
assert dataset.outputs_schema_definition == OutputSchema.model_json_schema()
assert dataset.inputs_schema == InputSchema.model_json_schema()
assert dataset.outputs_schema == OutputSchema.model_json_schema()

# create an example that matches the schema, which should succeed
langchain_client.create_example(
Expand All @@ -404,8 +404,8 @@ class OutputSchema(BaseModel):

# assert read API includes the schema definition
read_dataset = langchain_client.read_dataset(dataset_id=dataset.id)
assert read_dataset.inputs_schema_definition == InputSchema.model_json_schema()
assert read_dataset.outputs_schema_definition == OutputSchema.model_json_schema()
assert read_dataset.inputs_schema == InputSchema.model_json_schema()
assert read_dataset.outputs_schema == OutputSchema.model_json_schema()

langchain_client.delete_dataset(dataset_id=dataset.id)

Expand Down

0 comments on commit 32e7d7a

Please sign in to comment.