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

Đang mở
#18,917 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
67/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart, firebase, flutter
Lĩnh vực
api, mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Dart
Star
9.3k
Fork
4.1k
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
69

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/flutterfire

Tất cả issue của firebase/flutterfire

Issue tương tự

Thêm issue về Dart

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.