-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botlive[Component] This issue is related to live, voice and video chat[Component] This issue is related to live, voice and video chat
Milestone
Description
Streaming Conversation History Fragmentation Issue
Problem Description
When using the Gemini Live API with ADK for streaming conversations, the conversation history becomes severely fragmented due to how streaming chunks are stored. Each individual streaming token/chunk is saved as a separate Content
entry in the conversation history instead of being consolidated into meaningful conversation turns.
Example of Fragmented History
Content(parts=[Part(text=' Hey')], role='user'),
Content(parts=[Part(text=',')], role='user'),
Content(parts=[Part(text=' how')], role='user'),
Content(parts=[Part(text=' you')], role='user'),
Content(parts=[Part(text=' do')], role='user'),
Content(parts=[Part(text='ing')], role='user'),
Content(parts=[Part(text='?')], role='user'),
Content(parts=[Part(text="I'm doing well, thank you for asking! How can I help you today?")], role='model'),
Content(parts=[Part(text=' I')], role='user'),
Content(parts=[Part(text=' would')], role='user'),
Content(parts=[Part(text=' like')], role='user'),
# ... and so on
Impact
- Token Waste: Massive token consumption due to fragmented history
- Context Degradation: Important conversation context gets lost as history grows
- Performance Issues: Slower response times due to excessive tokens
- Cost Escalation: Higher API costs due to unnecessary token usage
- Model Confusion: Fragmented context may confuse the model's understanding
ravi-incred
Metadata
Metadata
Assignees
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botlive[Component] This issue is related to live, voice and video chat[Component] This issue is related to live, voice and video chat