functionCallingMode property
Controls how the model decides when to call functions.
- GoogleFunctionCallingMode.auto (default): Model decides whether to call a function or give a natural language response.
- GoogleFunctionCallingMode.any: Model is constrained to always predict a function call. Use with allowedFunctionNames to limit which functions can be called.
- GoogleFunctionCallingMode.none: Model will not predict any function calls, behaves as if no functions were provided.
- GoogleFunctionCallingMode.validated: Like auto but validates function calls with constrained decoding.
Example:
GoogleChatModelOptions(
functionCallingMode: GoogleFunctionCallingMode.any,
allowedFunctionNames: ['get_weather', 'get_forecast'],
)
Implementation
final GoogleFunctionCallingMode? functionCallingMode;