mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
chore: Clarify support-related Exceptions in utils.py (#5447)
Improved the clarity of Exceptions in supports_system_messages, supports_response_schema, supports_function_calling, and supports_parallel_function_calling. Previously, it was difficult to determine the cause of Exception logs due to vague messaging. Each case now includes a more specific and appropriate Exception message.
This commit is contained in:
parent
7f1531006c
commit
5b1d9712c5
1 changed files with 4 additions and 4 deletions
|
@ -2103,7 +2103,7 @@ def supports_system_messages(model: str, custom_llm_provider: Optional[str]) ->
|
|||
return False
|
||||
except Exception:
|
||||
raise Exception(
|
||||
f"Model not in model_prices_and_context_window.json. You passed model={model}, custom_llm_provider={custom_llm_provider}."
|
||||
f"Model not supports system messages. You passed model={model}, custom_llm_provider={custom_llm_provider}."
|
||||
)
|
||||
|
||||
|
||||
|
@ -2139,7 +2139,7 @@ def supports_response_schema(model: str, custom_llm_provider: Optional[str]) ->
|
|||
return False
|
||||
except Exception:
|
||||
verbose_logger.error(
|
||||
f"Model not in model_prices_and_context_window.json. You passed model={model}, custom_llm_provider={custom_llm_provider}."
|
||||
f"Model not supports response_schema. You passed model={model}, custom_llm_provider={custom_llm_provider}."
|
||||
)
|
||||
return False
|
||||
|
||||
|
@ -2165,7 +2165,7 @@ def supports_function_calling(model: str) -> bool:
|
|||
return False
|
||||
else:
|
||||
raise Exception(
|
||||
f"Model not in model_prices_and_context_window.json. You passed model={model}."
|
||||
f"Model not supports function calling. You passed model={model}."
|
||||
)
|
||||
|
||||
|
||||
|
@ -2211,7 +2211,7 @@ def supports_parallel_function_calling(model: str):
|
|||
return False
|
||||
else:
|
||||
raise Exception(
|
||||
f"Model not in model_prices_and_context_window.json. You passed model={model}."
|
||||
f"Model not supports parallel function calling. You passed model={model}."
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue