ThinkingConfig
public struct ThinkingConfig : Sendableextension ThinkingConfig: EncodableConfiguration 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, includeThoughts: Bool? = nil)Parameters
thinkingBudgetThe maximum number of tokens to be used for the model’s thinking process.
includeThoughtsIf true, summaries of the model’s “thoughts” are included in responses.