mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
fix - gemini function calling
This commit is contained in:
parent
3d5944b9cc
commit
f2c1c20cc1
1 changed files with 20 additions and 4 deletions
|
@ -553,7 +553,12 @@ def test_gemini_pro_function_calling():
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
|
messages = [
|
||||||
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content": "What's the weather like in Boston today in fahrenheit?",
|
||||||
|
}
|
||||||
|
]
|
||||||
completion = litellm.completion(
|
completion = litellm.completion(
|
||||||
model="gemini-pro", messages=messages, tools=tools, tool_choice="auto"
|
model="gemini-pro", messages=messages, tools=tools, tool_choice="auto"
|
||||||
)
|
)
|
||||||
|
@ -586,7 +591,10 @@ def test_gemini_pro_function_calling():
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
messages = [
|
messages = [
|
||||||
{"role": "user", "content": "What's the weather like in Boston today?"}
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content": "What's the weather like in Boston today in fahrenheit?",
|
||||||
|
}
|
||||||
]
|
]
|
||||||
completion = litellm.completion(
|
completion = litellm.completion(
|
||||||
model="gemini-pro", messages=messages, tools=tools, tool_choice="auto"
|
model="gemini-pro", messages=messages, tools=tools, tool_choice="auto"
|
||||||
|
@ -629,7 +637,12 @@ def test_gemini_pro_function_calling_streaming():
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
|
messages = [
|
||||||
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content": "What's the weather like in Boston today in fahrenheit?",
|
||||||
|
}
|
||||||
|
]
|
||||||
try:
|
try:
|
||||||
completion = litellm.completion(
|
completion = litellm.completion(
|
||||||
model="gemini-pro",
|
model="gemini-pro",
|
||||||
|
@ -675,7 +688,10 @@ async def test_gemini_pro_async_function_calling():
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
messages = [
|
messages = [
|
||||||
{"role": "user", "content": "What's the weather like in Boston today?"}
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content": "What's the weather like in Boston today in fahrenheit?",
|
||||||
|
}
|
||||||
]
|
]
|
||||||
completion = await litellm.acompletion(
|
completion = await litellm.acompletion(
|
||||||
model="gemini-pro", messages=messages, tools=tools, tool_choice="auto"
|
model="gemini-pro", messages=messages, tools=tools, tool_choice="auto"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue