Skip to content

Disabling automatic function calling with streaming #331

Description

@AustinKP

Whenever I disable automatic function calling I'm getting the following warning and it's stopping the stream from responding entirely.

WARNING:root:automatic_function_calling.disable is set to True. But automatic_function_calling.maximum_remote_calls is set to be a positive number 10. Disabling automatic function calling. If you want to enable automatic function calling, please set automatic_function_calling.disable to False or leave it unset, and set automatic_function_calling.maximum_remote_calls to a positive integer or leave automatic_function_calling.maximum_remote_calls unset.

   chat = client.chats.create(
         model='gemini-2.0-flash',
         config=types.GenerateContentConfig(
            system_instruction=system_prompt,
            tools=[edit_guide, create_guide],
            automatic_function_calling={'disable': True},
         ),
        history=history   
    )

I tried setting the maximum remote calls to 0 but this throws another warning about the value must be > 0

WARNING:root:max_remote_calls in automatic_function_calling_config 0 is less than or equal to 0. Disabling automatic function calling. Please set max_remote_calls to a positive integer.

Am I missing something here? How do you disable automatic function calling with streaming?

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions