Streaming in speech generation is not working
Description of the bug:
from google import genai from google.genai import types import pyaudio # You'll need to install PyAudio
client = genai.Client(api_key="GEMINI_API_KEY")
... response code
stream = pya.open( format=FORMAT, channels=CHANNELS, rate=RECEIVE_SAMPLE_RATE, output=True)
def play_audio(chunks): chunk: Blob for chunk in chunks: stream.write(chunk.data)
The example of getting streaming data is not complete, the standard response code is sending the whole file.
Actual vs expected behavior:
No response
Any other information you'd like to share?
No response
Also facing the same issue, any plan to add support for streaming for gemini-2.5-flash-preview-tts and gemini-2.5-pro-preview-tts?
The documentation has a streaming support section, but generate_content_stream returns only one chunk which contains the complete response.
Please add streaming support!