From 6e480927460c5a7bebfd5d3b86a29e68fc111f97 Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Mon, 18 Sep 2023 07:12:48 -0700 Subject: [PATCH] Update LangSmith Version (#10722) And assign dataset ID upon project creation --- libs/langchain/langchain/smith/evaluation/runner_utils.py | 7 +++++-- libs/langchain/poetry.lock | 8 ++++---- libs/langchain/pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libs/langchain/langchain/smith/evaluation/runner_utils.py b/libs/langchain/langchain/smith/evaluation/runner_utils.py index 8eea9ef26b..09845f89a7 100644 --- a/libs/langchain/langchain/smith/evaluation/runner_utils.py +++ b/libs/langchain/langchain/smith/evaluation/runner_utils.py @@ -857,8 +857,12 @@ def _prepare_eval_run( project_name: str, ) -> Tuple[MCF, str, Dataset, List[Example]]: wrapped_model = _wrap_in_chain_factory(llm_or_chain_factory, dataset_name) + dataset = client.read_dataset(dataset_name=dataset_name) try: - project = client.create_project(project_name) + project = client.create_project( + project_name, + reference_dataset_id=dataset.id, + ) except ValueError as e: if "already exists " not in str(e): raise e @@ -869,7 +873,6 @@ def _prepare_eval_run( f"View the evaluation results for project '{project_name}' at:\n{project.url}", flush=True, ) - dataset = client.read_dataset(dataset_name=dataset_name) examples = list(client.list_examples(dataset_id=dataset.id)) if not examples: raise ValueError(f"Dataset {dataset_name} has no example rows.") diff --git a/libs/langchain/poetry.lock b/libs/langchain/poetry.lock index 399dcc2cab..2df4db9ae7 100644 --- a/libs/langchain/poetry.lock +++ b/libs/langchain/poetry.lock @@ -3930,13 +3930,13 @@ all = ["datasets (>=2.12.0,<3.0.0)", "evaluate (>=0.4.0,<0.5.0)", "nltk (>=3.8.1 [[package]] name = "langsmith" -version = "0.0.25" +version = "0.0.38" 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.0.25-py3-none-any.whl", hash = "sha256:d595435ad21fa6077550d7c85472935d1e8241afa042c1e29287d2c95c3ed151"}, - {file = "langsmith-0.0.25.tar.gz", hash = "sha256:e728c398fc1adaa0ed8abeb21f6a92d7fb19fe3ab49d3911c22b03dfe25935d6"}, + {file = "langsmith-0.0.38-py3-none-any.whl", hash = "sha256:3bdb107d7b847e0f42a89ce67080aad086db230dec9647b13eb7af37e3d8ff1d"}, + {file = "langsmith-0.0.38.tar.gz", hash = "sha256:508f2a949135055f27d82848ad4dc37b3c2f00f5e05e5296883c65ef528b148f"}, ] [package.dependencies] @@ -10491,4 +10491,4 @@ text-helpers = ["chardet"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "b63078268a80c07577b432114302f4f86d47be25b83a245affb0dbc999fb2c1f" +content-hash = "75648828833909395b8d6fc4152b3d0953ba05e8cfd5e86e82e011bd3054e57c" diff --git a/libs/langchain/pyproject.toml b/libs/langchain/pyproject.toml index 06f1a6b79d..3895c0c74b 100644 --- a/libs/langchain/pyproject.toml +++ b/libs/langchain/pyproject.toml @@ -113,7 +113,7 @@ cassio = {version = "^0.1.0", optional = true} rdflib = {version = "^6.3.2", optional = true} sympy = {version = "^1.12", optional = true} rapidfuzz = {version = "^3.1.1", optional = true} -langsmith = "~0.0.21" +langsmith = "~0.0.38" rank-bm25 = {version = "^0.2.2", optional = true} amadeus = {version = ">=8.1.0", optional = true} geopandas = {version = "^0.13.1", optional = true}