I have the following code to enabling function calling with gemini-pro model (it is based on this example).
def getWordCount(sentence:str):
return len(sentence.split(' '))
model = genai.GenerativeModel(model_name='models/gemini-pro', tools=[getWordCount])
model._tools.to_proto()
For some reason, I received the following error:
TypeError: Invalid constructor input for Tool: <function getWordCount at 0x7a9baaf95c60>
The error repeats for all the following models:
models/gemini-1.0-pro
models/gemini-1.0-pro-001
models/gemini-1.0-pro-latest
models/gemini-1.0-pro-vision-latest
models/gemini-pro
models/gemini-pro-vision
I could not find any resources to resolve this issue. I appreciate any help.