Skip to content

Commit

Permalink
Minimize Repr (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Oct 30, 2024
1 parent 812c0b0 commit 3f0ef5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/langsmith/run_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ def to_headers(self) -> Dict[str, str]:
headers["baggage"] = baggage.to_header()
return headers

def __repr__(self):
"""Return a string representation of the RunTree object."""
return (
f"RunTree(id={self.id}, name='{self.name}', "
f"run_type='{self.run_type}', dotted_order='{self.dotted_order}')"
)


class _Baggage:
"""Baggage header information."""
Expand Down
4 changes: 4 additions & 0 deletions python/langsmith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ def revision_id(self) -> Optional[UUID]:
"""Retrieve the revision ID (if any)."""
return self.metadata.get("revision_id")

def __repr__(self):
"""Return a string representation of the RunBase object."""
return f"{self.__class__}(id={self.id}, name='{self.name}', run_type='{self.run_type}')"


class Run(RunBase):
"""Run schema when loading from the DB."""
Expand Down

0 comments on commit 3f0ef5e

Please sign in to comment.