From 5c43494dc79c419ab69e22e91fd515a1b8052b7c Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Wed, 18 Sep 2024 22:53:46 -0700 Subject: [PATCH] [Py] Defaults in Example (#1017) --- python/langsmith/schemas.py | 7 +++++-- python/pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python/langsmith/schemas.py b/python/langsmith/schemas.py index 4985109d1..602f08293 100644 --- a/python/langsmith/schemas.py +++ b/python/langsmith/schemas.py @@ -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) @@ -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 diff --git a/python/pyproject.toml b/python/pyproject.toml index 46582df93..bc791b524 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -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 "] license = "MIT"