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

Abierto
#18,917 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
67/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
dart, firebase, flutter
Área
api, mobile

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Dart
Estrellas
9.3k
Forks
4.1k
Merge medio
1 d 9 h
PR fusionados (30 d)
69

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de firebase/flutterfire

Todos los issues de firebase/flutterfire

Issues similares

Más issues de Dart

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.