generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

FunctionCalling: `Tools` only allows one `function_declarations` tool.

Open MarkDaoust opened this issue 11 months ago • 1 comments

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

MarkDaoust avatar Mar 15 '24 17:03 MarkDaoust

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
                                       )

LindaLawton avatar Mar 19 '24 10:03 LindaLawton