-
-
Notifications
You must be signed in to change notification settings - Fork 905
Description
- This is actually a bug report.
- I have tried searching the documentation and have not found an answer.
What Model are you using?
- Gemini models
Describe the bug
When using instructor.from_genai() with Mode.GENAI_STRUCTURED_OUTPUTS, the automatic_function_calling configuration is not preserved when the library constructs the GenerateContentConfig.
This causes AFC to remain enabled by default, resulting in noisy log messages:
AFC is enabled with max remote calls: 10.
To Reproduce
Steps to reproduce the behavior, including code snippets of the model and the input data and openai response.
Expected behavior
When passing a config with automatic_function_calling=AutomaticFunctionCallingConfig(disable=True) the setting should be forwarded to the underlying Google GenAI client.
Current Behavior
The handle_genai_structured_outputs() function in instructor/providers/gemini/utils.py creates a new GenerateContentConfig but does not include automatic_function_calling in the update_genai_kwargs() function, causing the setting to be lost.