Skip to content

Commit

Permalink
[Py] Defaults in Example (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Sep 19, 2024
1 parent 30e4436 commit 5c43494
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions python/langsmith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ExampleBase(BaseModel):
"""Example base model."""

dataset_id: UUID
inputs: Dict[str, Any]
inputs: Dict[str, Any] = Field(default_factory=dict)
outputs: Optional[Dict[str, Any]] = Field(default=None)
metadata: Optional[Dict[str, Any]] = Field(default=None)

Expand All @@ -70,7 +70,10 @@ class Example(ExampleBase):
"""Example model."""

id: UUID
created_at: datetime
created_at: datetime = Field(
default_factory=lambda: datetime.fromtimestamp(0, tz=timezone.utc)
)
dataset_id: UUID = Field(default=UUID("00000000-0000-0000-0000-000000000000"))
modified_at: Optional[datetime] = Field(default=None)
runs: List[Run] = Field(default_factory=list)
source_run_id: Optional[UUID] = None
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langsmith"
version = "0.1.122"
version = "0.1.123"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 5c43494

Please sign in to comment.