From 3b220fa2a8d5f51315fd9a94132c6fbefa09125f Mon Sep 17 00:00:00 2001 From: Ulises M <30765968+lbux@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:11:39 -0800 Subject: [PATCH] comments + assert test --- .../components/evaluators/uptrain/evaluator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/integrations/uptrain/src/haystack_integrations/components/evaluators/uptrain/evaluator.py b/integrations/uptrain/src/haystack_integrations/components/evaluators/uptrain/evaluator.py index 8c31162ce..b35a93bc1 100644 --- a/integrations/uptrain/src/haystack_integrations/components/evaluators/uptrain/evaluator.py +++ b/integrations/uptrain/src/haystack_integrations/components/evaluators/uptrain/evaluator.py @@ -53,6 +53,8 @@ def __init__( The API key to use. :param api_params: Additional parameters to pass to the API client. + :param project_name: + Name of the project required when using UpTrain API. """ self.metric = metric if isinstance(metric, UpTrainMetric) else UpTrainMetric.from_str(metric) self.metric_params = metric_params @@ -195,6 +197,9 @@ def _init_backend(self): if self.api == "openai": backend_client = EvalLLM(openai_api_key=api_key) elif self.api == "uptrain": + if not self.project_name: + msg = f"project_name not provided. UpTrain API requires a project name." + raise ValueError(msg) backend_client = APIClient(uptrain_api_key=api_key) self._backend_metric = backend_metric