Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Jan 31, 2024
1 parent fec98a3 commit f5ac5d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/langsmith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ class Run(RunBase):
"""Time the first token was processed."""
parent_run_ids: Optional[List[UUID]] = None
"""List of parent run IDs."""
trace_id: Optional[UUID] = None
trace_id: UUID
"""Unique ID assigned to every run within this nested trace."""
dotted_order: Optional[str] = None
dotted_order: str = Field(default="")
"""Dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be
Expand All @@ -275,8 +275,12 @@ class Run(RunBase):

def __init__(self, _host_url: Optional[str] = None, **kwargs: Any) -> None:
"""Initialize a Run object."""
if not kwargs.get("trace_id"):
kwargs = {"trace_id": kwargs.get("id"), **kwargs}
super().__init__(**kwargs)
self._host_url = _host_url
if not self.dotted_order.strip():
self.dotted_order = f"{self.start_time.isoformat()}{self.id}"

@property
def url(self) -> Optional[str]:
Expand Down

0 comments on commit f5ac5d9

Please sign in to comment.