forked from phoenix/litellm-mirror
add_function_to_prompt bug fix
This blows up when there's no "functions" in the dictionary even when tools is present because the inner function executes regardless (does not short circuit).
This commit is contained in:
parent
7d2aa2f645
commit
fc0ced48c1
1 changed files with 1 additions and 1 deletions
|
@ -4956,7 +4956,7 @@ def get_optional_params(
|
||||||
litellm.add_function_to_prompt
|
litellm.add_function_to_prompt
|
||||||
): # if user opts to add it to prompt instead
|
): # if user opts to add it to prompt instead
|
||||||
optional_params["functions_unsupported_model"] = non_default_params.pop(
|
optional_params["functions_unsupported_model"] = non_default_params.pop(
|
||||||
"tools", non_default_params.pop("functions")
|
"tools", non_default_params.pop("functions", None)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise UnsupportedParamsError(
|
raise UnsupportedParamsError(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue