updated context seeding to allow gemini 3.1 to greet the user
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user