mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(utils.py): check if tools is iterable before indexing into it
Fixes https://github.com/BerriAI/litellm/issues/4933
This commit is contained in:
parent
a2939c2f08
commit
52b1ca292c
1 changed files with 3 additions and 1 deletions
|
@ -2772,7 +2772,9 @@ def get_optional_params(
|
||||||
message=f"Function calling is not supported by {custom_llm_provider}.",
|
message=f"Function calling is not supported by {custom_llm_provider}.",
|
||||||
)
|
)
|
||||||
|
|
||||||
if "tools" in non_default_params:
|
if "tools" in non_default_params and isinstance(
|
||||||
|
non_default_params, list
|
||||||
|
): # fixes https://github.com/BerriAI/litellm/issues/4933
|
||||||
tools = non_default_params["tools"]
|
tools = non_default_params["tools"]
|
||||||
for (
|
for (
|
||||||
tool
|
tool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue