generative-ai-python
generative-ai-python copied to clipboard
FunctionCalling: `Tools` only allows one `function_declarations` tool.
Description of the bug:
SDK should fix or error faster.
Actual vs expected behavior:
No response
Any other information you'd like to share?
No response
Not sure I understand the issue here. I send sevral
get_now = glm.Tool(
function_declarations=[
glm.FunctionDeclaration(
name='now',
description="Returns the current UTC date and time."
)
]
)
fallback = glm.Tool(
function_declarations=[
glm.FunctionDeclaration(
name='fallback',
description="Any request by the user not relating to time."
)
]
)
You can send as many as you want.
self.model = genai.GenerativeModel(model_name=CHAT_MODEL_NAME,
tools=[get_now, fallback],
generation_config=self.generation_config,
safety_settings=self.safety_settings
)