forked from phoenix/litellm-mirror
unit test and list fix
This commit is contained in:
parent
fc0ced48c1
commit
1b811cd152
2 changed files with 10 additions and 1 deletions
|
@ -0,0 +1,9 @@
|
||||||
|
import litellm
|
||||||
|
from litellm import get_optional_params
|
||||||
|
|
||||||
|
litellm.add_function_to_prompt = True
|
||||||
|
optional_params = get_optional_params(
|
||||||
|
tools= [{'type': 'function', 'function': {'description': 'Get the current weather in a given location', 'name': 'get_current_weather', 'parameters': {'type': 'object', 'properties': {'location': {'type': 'string', 'description': 'The city and state, e.g. San Francisco, CA'}, 'unit': {'type': 'string', 'enum': ['celsius', 'fahrenheit']}}, 'required': ['location']}}}],
|
||||||
|
tool_choice= 'auto',
|
||||||
|
)
|
||||||
|
assert optional_params is not None
|
|
@ -5769,7 +5769,7 @@ def get_optional_params(
|
||||||
optional_params["extra_body"] = extra_body
|
optional_params["extra_body"] = extra_body
|
||||||
else:
|
else:
|
||||||
# if user passed in non-default kwargs for specific providers/models, pass them along
|
# if user passed in non-default kwargs for specific providers/models, pass them along
|
||||||
for k in passed_params.keys():
|
for k in list(passed_params.keys()):
|
||||||
if k not in default_params.keys():
|
if k not in default_params.keys():
|
||||||
optional_params[k] = passed_params[k]
|
optional_params[k] = passed_params[k]
|
||||||
print_verbose(f"Final returned optional params: {optional_params}")
|
print_verbose(f"Final returned optional params: {optional_params}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue