diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 64d1008a7..548965f97 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -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. @@ -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. @@ -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: diff --git a/python/pyproject.toml b/python/pyproject.toml index eeddd9060..898f7f078 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -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 "] license = "MIT"