mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(anthropic/chat/transformation.py): ignore user mapping if email given (e.g. from openwebui)
Closes https://github.com/BerriAI/litellm/issues/10106
This commit is contained in:
parent
b1e00b3724
commit
0e10e73f31
2 changed files with 10 additions and 1 deletions
|
|
@ -479,7 +479,12 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
|
|||
optional_params = self._add_tools_to_optional_params(
|
||||
optional_params=optional_params, tools=[_tool]
|
||||
)
|
||||
if param == "user":
|
||||
if (
|
||||
param == "user"
|
||||
and value is not None
|
||||
and isinstance(value, str)
|
||||
and _valid_user_id(value) # anthropic fails on emails
|
||||
):
|
||||
optional_params["metadata"] = {"user_id": value}
|
||||
if param == "thinking":
|
||||
optional_params["thinking"] = value
|
||||
|
|
|
|||
|
|
@ -82,6 +82,10 @@ model_list:
|
|||
litellm_params:
|
||||
model: "openai/*"
|
||||
api_key: os.environ/OPENAI_API_KEY_TEST
|
||||
- model_name: "anthropic-claude"
|
||||
litellm_params:
|
||||
model: "anthropic/claude-3-5-sonnet-latest"
|
||||
api_key: os.environ/ANTHROPIC_API_KEY
|
||||
|
||||
general_settings:
|
||||
store_model_in_db: true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue