The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Update error message in evaluation runner (#13296)
William FH9169d77cf66e
diff --git a/libs/langchain/langchain/smith/evaluation/runner_utils.py b/libs/langchain/langchain/smith/evaluation/runner_utils.pyindex e1b78a00f0..1e17652f39 100644--- a/libs/langchain/langchain/smith/evaluation/runner_utils.py+++ b/libs/langchain/langchain/smith/evaluation/runner_utils.py@@ -5,6 +5,7 @@ from __future__ import annotationsimport functoolsimport inspectimport logging+import uuidfrom enum import Enumfrom typing import (TYPE_CHECKING,@@ -23,6 +24,8 @@ from langsmith.client import Clientfrom langsmith.evaluation import RunEvaluatorfrom langsmith.run_helpers import as_runnable, is_traceable_functionfrom langsmith.schemas import Dataset, DataType, Example+from langsmith.utils import LangSmithError+from requests import HTTPErrorfrom langchain._api import warn_deprecatedfrom langchain.callbacks.manager import Callbacks@@ -880,11 +883,19 @@ def _prepare_eval_run(reference_dataset_id=dataset.id,project_extra={"metadata": project_metadata} if project_metadata else {},)- except ValueError as e:+ except (HTTPError, ValueError, LangSmithError) as e:if "already exists " not in str(e):raise e+ uid = uuid.uuid4()+ example_msg = f"""+run_on_dataset(+ ...+ project_name="{project_name} - {uid}", # Update since {project_name} already exists+)+"""raise ValueError(- f"Project {project_name} already exists. Please use a different name."+ f"Test project {project_name} already exists. Please use a different name:"+ f"\n\n{example_msg}")print(f"View the evaluation results for project '{project_name}'"