Skip to content

Commit

Permalink
NA: Fixing the side effects of the function and printing the correct …
Browse files Browse the repository at this point in the history
…error message (#518)

* fix - print real key name

* fix do not change original passed dict
  • Loading branch information
japdubengsub authored Oct 30, 2024
1 parent fd3affd commit 604170e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sdks/python/src/opik/evaluation/models/litellm_chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ def _check_must_support_arguments(self, args: Optional[List[str]]) -> None:
raise ValueError(f"Unsupported parameter: '{key}'!")

def _filter_supported_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
valid_params = params
valid_params = {}

for key in params:
for key, value in params.items():
if key not in self.supported_params:
LOGGER.debug(
"This model does not support the {key} parameter and it has been ignored."
f"This model does not support the '{key}' parameter and it has been ignored."
)
valid_params.pop(key, None)
else:
valid_params[key] = value

return valid_params

Expand Down

0 comments on commit 604170e

Please sign in to comment.