diff --git a/libs/langchain/langchain/smith/evaluation/runner_utils.py b/libs/langchain/langchain/smith/evaluation/runner_utils.py index 901e6811463..6a37bcc9d8d 100644 --- a/libs/langchain/langchain/smith/evaluation/runner_utils.py +++ b/libs/langchain/langchain/smith/evaluation/runner_utils.py @@ -979,20 +979,15 @@ def _prepare_eval_run( ) -> Tuple[MCF, TracerSession, Dataset, List[Example]]: wrapped_model = _wrap_in_chain_factory(llm_or_chain_factory, dataset_name) dataset = client.read_dataset(dataset_name=dataset_name) - as_of = dataset_version if isinstance(dataset_version, datetime) else None - if isinstance(dataset_version, str): - raise NotImplementedError( - "Selecting dataset_version by tag is not yet supported." - " Please use a datetime object." - ) - examples = list(client.list_examples(dataset_id=dataset.id, as_of=as_of)) + + examples = list(client.list_examples(dataset_id=dataset.id, as_of=dataset_version)) if not examples: raise ValueError(f"Dataset {dataset_name} has no example rows.") modified_at = [ex.modified_at for ex in examples if ex.modified_at] # Should always be defined in practice when fetched, # but the typing permits None max_modified_at = max(modified_at) if modified_at else None - dataset_version = max_modified_at.isoformat() if max_modified_at else None + inferred_version = max_modified_at.isoformat() if max_modified_at else None try: project_metadata = project_metadata or {} @@ -1003,7 +998,7 @@ def _prepare_eval_run( "git": git_info, } - project_metadata["dataset_version"] = dataset_version + project_metadata["dataset_version"] = inferred_version project = client.create_project( project_name, reference_dataset_id=dataset.id, diff --git a/libs/langchain/poetry.lock b/libs/langchain/poetry.lock index 55565f298fb..9d45c0753d3 100644 --- a/libs/langchain/poetry.lock +++ b/libs/langchain/poetry.lock @@ -3525,13 +3525,13 @@ url = "../text-splitters" [[package]] name = "langsmith" -version = "0.1.14" +version = "0.1.17" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langsmith-0.1.14-py3-none-any.whl", hash = "sha256:ecb243057d2a43c2da0524fe395585bc3421bb5d24f1cdd53eb06fbe63e43a69"}, - {file = "langsmith-0.1.14.tar.gz", hash = "sha256:b95f267d25681f4c9862bb68236fba8a57a60ec7921ecfdaa125936807e51bde"}, + {file = "langsmith-0.1.17-py3-none-any.whl", hash = "sha256:563e88d8629db23cfd5312b96fd3c6cbf990fdf2abb404d2fba3b76a73f4828f"}, + {file = "langsmith-0.1.17.tar.gz", hash = "sha256:1a4aed855a97aae01276c832c6857b3902d910065abdb0de36ae2ad520edd92a"}, ] [package.dependencies] @@ -9132,4 +9132,4 @@ text-helpers = ["chardet"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "095a661dc5f767d2a3c92541d66c2d3070e86fb455b98f313e6c9a40b699b4ef" +content-hash = "2b679b5f0fd928dce161ca83d167111ad896cbd405931558e9e3dcb83353d8ff" diff --git a/libs/langchain/pyproject.toml b/libs/langchain/pyproject.toml index 6bca8997d72..99d33eb0e8e 100644 --- a/libs/langchain/pyproject.toml +++ b/libs/langchain/pyproject.toml @@ -15,7 +15,7 @@ python = ">=3.8.1,<4.0" langchain-core = ">=0.1.28,<0.2" langchain-text-splitters = ">=0.0.1,<0.1" langchain-community = ">=0.0.25,<0.1" -langsmith = "^0.1.14" +langsmith = "^0.1.17" pydantic = ">=1,<3" SQLAlchemy = ">=1.4,<3" requests = "^2"