All Google Gemini models that can generate text and support function calling works well if tools are not provided but when tools provided, they don't answer a simple query other than related to those functions.
Actual vs expected behavior:
Expected:
import google.generativeai as genai
def multiply(a:float, b:float):
"""returns a * b."""
return a*b
model = genai.GenerativeModel(model_name='gemini-1.0-pro',
tools=[multiply])
chat = model.start_chat(enable_automatic_function_calling=True)
response = chat.send_message('who is the president of usa')
response.text
Output:'Joe Biden'
Actual:
import google.generativeai as genai
def multiply(a:float, b:float):
"""returns a * b."""
return a*b
model = genai.GenerativeModel(model_name='gemini-1.0-pro',
tools=[multiply])
chat = model.start_chat(enable_automatic_function_calling=True)
response = chat.send_message('who is the president of usa')
response.text
Output:'I cannot fulfill this request. The available tools lack the desired functionality.' or 'I am sorry, I do not have access to real-time information, including information about current events or the President of the United States. \n'
or 'This question cannot be answered from the given source.'
Any other information you'd like to share?
However, it works fine tools are not given
import google.generativeai as genai
def multiply(a:float, b:float):
"""returns a * b."""
return a*b
model = genai.GenerativeModel(model_name='gemini-1.0-pro')
chat = model.start_chat()
response = chat.send_message('who is the president of usa')
response.text
Description of the bug:
All Google Gemini models that can generate text and support function calling works well if tools are not provided but when tools provided, they don't answer a simple query other than related to those functions.
Actual vs expected behavior:
Expected:
Output: 'Joe Biden'
Actual:
Output: 'I cannot fulfill this request. The available tools lack the desired functionality.' or 'I am sorry, I do not have access to real-time information, including information about current events or the President of the United States. \n' or 'This question cannot be answered from the given source.'
Any other information you'd like to share?
However, it works fine tools are not given
Output: 'Joe Biden'