forked from phoenix/litellm-mirror
feat - new util supports_vision
This commit is contained in:
parent
351baf42b5
commit
fb8e256aba
1 changed files with 24 additions and 0 deletions
|
@ -4156,6 +4156,30 @@ def supports_function_calling(model: str):
|
|||
)
|
||||
|
||||
|
||||
def supports_vision(model: str):
|
||||
"""
|
||||
Check if the given model supports vision and return a boolean value.
|
||||
|
||||
Parameters:
|
||||
model (str): The model name to be checked.
|
||||
|
||||
Returns:
|
||||
bool: True if the model supports vision, False otherwise.
|
||||
|
||||
Raises:
|
||||
Exception: If the given model is not found in model_prices_and_context_window.json.
|
||||
"""
|
||||
if model in litellm.model_cost:
|
||||
model_info = litellm.model_cost[model]
|
||||
if model_info.get("supports_vision", False):
|
||||
return True
|
||||
return False
|
||||
else:
|
||||
raise Exception(
|
||||
f"Model not in model_prices_and_context_window.json. You passed model={model}."
|
||||
)
|
||||
|
||||
|
||||
def supports_parallel_function_calling(model: str):
|
||||
"""
|
||||
Check if the given model supports parallel function calling and return True if it does, False otherwise.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue