diff --git a/python/langsmith/client.py b/python/langsmith/client.py index a79bf19dd..801561f59 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -2555,11 +2555,12 @@ def create_dataset( inputs_schema=inputs_schema, outputs_schema=outputs_schema, ) + response = self.request_with_retries( "POST", "/datasets", headers={**self._headers, "Content-Type": "application/json"}, - data=dataset.json(), + data=dataset.json(by_alias=True), ) ls_utils.raise_for_status_with_text(response) return ls_schemas.Dataset( diff --git a/python/langsmith/schemas.py b/python/langsmith/schemas.py index f8bb26744..a57a509f5 100644 --- a/python/langsmith/schemas.py +++ b/python/langsmith/schemas.py @@ -128,12 +128,17 @@ class DatasetBase(BaseModel): name: str description: Optional[str] = None data_type: Optional[DataType] = None - inputs_schema: Optional[Dict[str, Any]] = None - outputs_schema: Optional[Dict[str, Any]] = None + inputs_schema: Optional[Dict[str, Any]] = Field( + None, alias="inputs_schema_definition" + ) + outputs_schema: Optional[Dict[str, Any]] = Field( + None, alias="outputs_schema_definition" + ) class Config: """Configuration class for the schema.""" + allow_population_by_field_name = True frozen = True