All Google Gemini models that can generate text and support function calling works well if tools are not provided
For example:
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
Output: ‘Joe Biden’
But when i integrate tools in it and query something else than tool, the model not works well.
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 ‘This question cannot be answered from the given source.’