fix - gemini function calling

This commit is contained in:
Ishaan Jaff 2024-04-16 20:53:02 -07:00
parent 3d5944b9cc
commit f2c1c20cc1

View file

@ -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"