Skip to content

Commit

Permalink
Nicer item repr (#2655)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Dec 5, 2024
1 parent a275ab2 commit 0f0e31d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libs/checkpoint/langgraph/store/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ def __hash__(self) -> int:

def dict(self) -> dict:
return {
"value": self.value,
"key": self.key,
"namespace": list(self.namespace),
"key": self.key,
"value": self.value,
"created_at": self.created_at.isoformat(),
"updated_at": self.updated_at.isoformat(),
}

def __repr__(self) -> str:
return f"Item({', '.join(f'{k}={v!r}' for k, v in self.dict().items())})"


class SearchItem(Item):
"""Represents an item returned from a search operation with additional metadata."""
Expand Down

0 comments on commit 0f0e31d

Please sign in to comment.