Skip to content

Commit

Permalink
comments + assert test
Browse files Browse the repository at this point in the history
  • Loading branch information
lbux authored Feb 21, 2024
1 parent 70c42a5 commit 3b220fa
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3b220fa

Please sign in to comment.