You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🚀 [firebase_ai] Public way to set thoughtSignature on request parts #18917
A public way to set thoughtSignature on the parts of a request.
Gemini 3 models return a thoughtSignature on response parts, and the API expects it back on those parts in later turns, otherwise multi-turn function calling with thinking fails. ChatSession handles this internally, but code that builds Content itself (for example a framework keeping its own message history) has no supported way to do it in firebase_ai 5.1.0:
Part keeps the signature in a private _thoughtSignature. It can be read back through toJson(), but not set.
The public TextPart, InlineDataPart, FileData and FunctionCall constructors pass thoughtSignature: null.
Only the @visibleForTesting.forTest constructors accept it, and parsePart isn't exported.
We use the .forTest constructors in the Genkit plugin for Firebase AI Logic (genkit_firebase_ai) to round-trip signatures, which works but relies on test-only API that could change in any release.
Any of these would solve it:
A thoughtSignature named parameter on the public part constructors (and ideally a public thoughtSignature getter on Part).
Exporting parsePart, so a part can be rebuilt from the JSON the API returned.
Activity