Skip to content

Commit

Permalink
[Python] list_examples by tag (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Mar 4, 2024
1 parent 9198f4c commit 3362883
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2652,7 +2652,7 @@ def list_examples(
dataset_id: Optional[ID_TYPE] = None,
dataset_name: Optional[str] = None,
example_ids: Optional[Sequence[ID_TYPE]] = None,
as_of: Optional[datetime.datetime] = None,
as_of: Optional[Union[datetime.datetime, str]] = None,
inline_s3_urls: bool = True,
) -> Iterator[ls_schemas.Example]:
"""Retrieve the example rows of the specified dataset.
Expand All @@ -2664,8 +2664,10 @@ def list_examples(
Defaults to None.
example_ids (List[UUID], optional): The IDs of the examples to filter by.
Defaults to None.
as_of (datetime, optional): The timestamp to retrieve the examples as of.
This determines the dataset version.
as_of (datetime, str, or optional): The dataset version tag OR
timestamp to retrieve the examples as of.
Response examples will only be those that were present at the time
of the tagged (or timestamped) version.
inline_s3_urls (bool, optional): Whether to inline S3 URLs.
Defaults to True.
Expand All @@ -2674,7 +2676,9 @@ def list_examples(
"""
params: Dict[str, Any] = {
"id": example_ids,
"as_of": as_of.isoformat() if as_of else None,
"as_of": (
as_of.isoformat() if isinstance(as_of, datetime.datetime) else as_of
),
"inline_s3_urls": inline_s3_urls,
}
if dataset_id is not None:
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langsmith"
version = "0.1.16"
version = "0.1.17"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 3362883

Please sign in to comment.