FirebaseAI Framework Reference

ThinkingConfig

public struct ThinkingConfig : Sendable
extension ThinkingConfig: Encodable

Configuration for controlling the “thinking” behavior of compatible Gemini models.

Certain models, like Gemini 2.5 Flash and Pro, utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer.

  • Initializes a new ThinkingConfig.

    Declaration

    Swift

    public init(thinkingBudget: Int? = nil)

    Parameters

    thinkingBudget

    The maximum number of tokens to be used for the model’s thinking process.