Merge pull request #2961 from pipecat-ai/pk/gemini-live-fix-session-resumption
Fix Gemini Live session resumption. The problem was that we weren't p…
This commit is contained in:
@@ -19,8 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed `GeminiLiveLLMService` session resumption after a connection timeout.
|
||||||
|
|
||||||
- `GeminiLiveLLMService` now properly supports context-provided system
|
- `GeminiLiveLLMService` now properly supports context-provided system
|
||||||
instruction and tools
|
instruction and tools.
|
||||||
|
|
||||||
## [0.0.92] - 2025-10-31 🎃 "The Haunted Edition" 👻
|
## [0.0.92] - 2025-10-31 🎃 "The Haunted Edition" 👻
|
||||||
|
|
||||||
|
|||||||
@@ -1717,13 +1717,17 @@ class GeminiLiveLLMService(LLMService):
|
|||||||
self._session_resumption_handle = update.new_handle
|
self._session_resumption_handle = update.new_handle
|
||||||
|
|
||||||
async def _handle_send_error(self, error: Exception):
|
async def _handle_send_error(self, error: Exception):
|
||||||
|
# Ignore "expected" errors that may have occurred for messages that
|
||||||
|
# were in-flight when a disconnection occurred.
|
||||||
|
if self._disconnecting or not self._session:
|
||||||
|
return
|
||||||
|
|
||||||
# In server-to-server contexts, a WebSocket error should be quite rare.
|
# In server-to-server contexts, a WebSocket error should be quite rare.
|
||||||
# Given how hard it is to recover from a send-side error with proper
|
# Given how hard it is to recover from a send-side error with proper
|
||||||
# state management, and that exponential backoff for retries can have
|
# state management, and that exponential backoff for retries can have
|
||||||
# cost/stability implications for a service cluster, let's just treat a
|
# cost/stability implications for a service cluster, let's just treat a
|
||||||
# send-side error as fatal.
|
# send-side error as fatal.
|
||||||
if not self._disconnecting:
|
await self.push_error(ErrorFrame(error=f"{self} Send error: {error}", fatal=True))
|
||||||
await self.push_error(ErrorFrame(error=f"{self} Send error: {error}", fatal=True))
|
|
||||||
|
|
||||||
def create_context_aggregator(
|
def create_context_aggregator(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user