diff --git a/js/package.json b/js/package.json index 6aa1c3a4c..0dbc6de86 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "langsmith", - "version": "0.0.51", + "version": "0.0.52", "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", "files": [ "dist/", diff --git a/js/src/schemas.ts b/js/src/schemas.ts index 8840e14e2..7c48f29ad 100644 --- a/js/src/schemas.ts +++ b/js/src/schemas.ts @@ -1,7 +1,15 @@ export interface TracerSession { + // The ID of the tenant, or organization tenant_id: string; + // The ID of the project (alias for session) id: string; + // The start time of the project start_time: number; + // The end time of the project + end_time?: number; + // A description of the project + description?: string; + // The name of the project name?: string; } diff --git a/python/langsmith/schemas.py b/python/langsmith/schemas.py index f2b7f188a..2b3fba966 100644 --- a/python/langsmith/schemas.py +++ b/python/langsmith/schemas.py @@ -379,6 +379,10 @@ class TracerSession(BaseModel): """The ID of the project.""" start_time: datetime = Field(default_factory=datetime.utcnow) """The time the project was created.""" + end_time: Optional[datetime] = None + """The time the project was ended.""" + description: Optional[str] = None + """The description of the project.""" name: Optional[str] = None """The name of the session.""" extra: Optional[Dict[str, Any]] = None @@ -400,6 +404,20 @@ def url(self) -> Optional[str]: return f"{self._host_url}/o/{self.tenant_id}/projects/p/{self.id}" return None + @property + def metadata(self) -> dict[str, Any]: + """Retrieve the metadata (if any).""" + if self.extra is None or "metadata" not in self.extra: + return {} + return self.extra["metadata"] + + @property + def tags(self) -> List[str]: + """Retrieve the tags (if any).""" + if self.extra is None or "tags" not in self.extra: + return [] + return self.extra["tags"] + class TracerSessionResult(TracerSession): """TracerSession schema returned when reading a project diff --git a/python/pyproject.toml b/python/pyproject.toml index b0a5eec60..bef235d91 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langsmith" -version = "0.0.71" +version = "0.0.72" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." authors = ["LangChain "] license = "MIT"