mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(vertex_httpx.py): Fix tool calling with empty param list
Fixes https://github.com/BerriAI/litellm/issues/5055
This commit is contained in:
parent
7d0196191f
commit
8812da04e3
3 changed files with 38 additions and 1 deletions
|
@ -337,3 +337,27 @@ def test_groq_parallel_function_call():
|
|||
print("second response\n", second_response)
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", ["gemini/gemini-1.5-pro"])
|
||||
def test_simple_function_call_function_param(model):
|
||||
try:
|
||||
litellm.set_verbose = True
|
||||
messages = [{"role": "user", "content": "What is the weather like in Boston?"}]
|
||||
response = completion(
|
||||
model=model,
|
||||
messages=messages,
|
||||
tools=[
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "plot",
|
||||
"description": "Generate plots",
|
||||
},
|
||||
}
|
||||
],
|
||||
tool_choice="auto",
|
||||
)
|
||||
print(f"response: {response}")
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue