updated context seeding to allow gemini 3.1 to greet the user

This commit is contained in:
Chad Bailey
2026-03-18 21:28:17 +00:00
parent 53388e0426
commit 38d7882f0f
3 changed files with 10 additions and 8 deletions

View File

@@ -98,6 +98,7 @@ try:
FunctionResponse,
GenerationConfig,
GroundingMetadata,
HistoryConfig,
HttpOptions,
LiveConnectConfig,
LiveServerMessage,
@@ -1204,6 +1205,7 @@ class GeminiLiveLLMService(LLMService):
input_audio_transcription=AudioTranscriptionConfig(),
output_audio_transcription=AudioTranscriptionConfig(),
session_resumption=SessionResumptionConfig(handle=session_resumption_handle),
history_config=HistoryConfig(initial_history_in_client_content=True),
)
# Add context window compression to configuration, if enabled
@@ -1505,9 +1507,9 @@ class GeminiLiveLLMService(LLMService):
await self.start_ttfb_metrics()
try:
await self._session.send_client_content(
turns=messages, turn_complete=self._inference_on_context_initialization
)
await self._session.send_client_content(turns=messages, turn_complete=False)
if self._inference_on_context_initialization:
await self._session.send_realtime_input(text=" ")
except Exception as e:
await self._handle_send_error(e)