🚀 [firebase_ai] Public way to set thoughtSignature on request parts

オープン
#18,917 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
67/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
dart, firebase, flutter
領域
api, mobile

調査の方向性

Start by reading the public part constructors and Part in the firebase_ai package, then check how ChatSession preserves thoughtSignature and how parsePart is exported. Confirm which proposed public API fits the package conventions and add or update focused tests for setting and round-tripping the signature. Done means callers can preserve it across turns without using test-only constructors.

索引モデルが issue の本文から書いたものです。

説明

What feature would you like to see?

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:

  1. A thoughtSignature named parameter on the public part constructors (and ideally a public thoughtSignature getter on Part).
  2. Exporting parsePart, so a part can be rebuilt from the JSON the API returned.
主要言語
Dart
スター
9.3k
フォーク
4.1k
平均マージ
1日 9時間
マージ済み PR(30日)
69

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firebase/flutterfire のほかの issue

firebase/flutterfire の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。