Commit Graph
8 Commits
Author SHA1 Message Date
Andrew Heard 384fed9a83 feat(ai): support speech metadata on text parts (#16749)
Add SpeechMetadata (public preview) so requests to Gemini
text-to-speech models can attach turn-level instructions to a
TextPart:

- speaker assigns the turn to a voice configured in
  MultiSpeakerVoiceConfig. Multi-speaker requests require it on
  every part.
- style describes sustained delivery, such as emotion, pacing, or
  volume, so it isn't read aloud as part of the transcript.
  Momentary sounds and pauses stay inline as vocal tags, such as
  <laugh> or <short pause>.

Set metadata with the new TextPart.init(_:speechMetadata:). The
existing init(_:) is kept so references like
[String].map(TextPart.init) still compile. TextPart.speechMetadata
and the SpeechMetadata properties are internal while the API is in
preview.

InternalPart encodes and decodes speechMetadata on the wire. History
doesn't merge streamed text parts that carry speech metadata, so
speaker turns stay separate.

Document the multi-speaker requirements on SpeechConfig,
MultiSpeakerVoiceConfig, and SpeakerVoiceConfig.

Replace the gemini-3.1-flash-tts-preview integration tests with a
TextToSpeechTests suite covering gemini-3.8-flash-tts and
gemini-3.8-flash-lite-tts in unary and streaming, single- and
multi-speaker requests.
2026-10-14 18:56:25 -04:00
Paul Beusterien dd61534812 fix(ai): harden handling of unexpected server response parts (#16756) 2026-10-02 07:26:35 -07:00
Andrew Heard 150698e98a [AI] Lower minimum required deployment targets (#15928) 2026-03-12 18:33:33 -04:00
Andrew Heard 10678f67bc [Firebase AI] Add CodeExecution tool support (#15280) 2025-09-05 20:59:24 -04:00
Andrew Heard 9f4c34bbdb [Firebase AI] Handle empty or unknown Part data (#15262) 2025-09-03 19:30:02 -04:00
Andrew Heard e176f012f7 [Firebase AI] Add support for thought summaries (#15096) 2025-08-18 19:44:47 -04:00
Andrew Heard 0be8ceca17 [Firebase AI] Add support for Gemma models with Developer API (#14823) 2025-05-06 18:56:04 -04:00
Andrew Heard 8a854c732b [Firebase AI] Add initial project structure (#14737)
# Conflicts:
#	FirebaseAI/Tests/Unit/Types/GenerateContentResponseTests.swift
#	FirebaseVertexAI/Sources/VertexAI.swift
2025-04-25 10:34:11 -04:00