Skip to content

Commit

Permalink
fix: fix gemini voice issue
Browse files Browse the repository at this point in the history
  • Loading branch information
plutoless committed Dec 23, 2024
1 parent ae17c15 commit 349353c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions agents/ten_packages/extension/gemini_v2v_python/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)
from ten.audio_frame import AudioFrameDataFmt
from ten_ai_base.const import CMD_PROPERTY_RESULT, CMD_TOOL_CALL
from ten_ai_base.llm import AsyncLLMBaseExtension
from ten_ai_base import AsyncLLMBaseExtension
from dataclasses import dataclass
from ten_ai_base.config import BaseConfig
from ten_ai_base.chat_memory import ChatMemory
Expand Down Expand Up @@ -55,6 +55,9 @@
LiveClientToolResponse,
FunctionCall,
FunctionResponse,
SpeechConfig,
VoiceConfig,
PrebuiltVoiceConfig,
)
from google.genai.live import AsyncSession
from PIL import Image
Expand Down Expand Up @@ -489,13 +492,13 @@ def tool_dict(tool: LLMToolMetadata):
system_instruction=Content(parts=[Part(text=self.config.prompt)]),
tools=tools,
# voice is currently not working
# speech_config=SpeechConfig(
# voice_config=VoiceConfig(
# prebuilt_voice_config=PrebuiltVoiceConfig(
# voice_name=self.config.voice
# )
# )
# ),
speech_config=SpeechConfig(
voice_config=VoiceConfig(
prebuilt_voice_config=PrebuiltVoiceConfig(
voice_name=self.config.voice
)
)
),
generation_config=GenerationConfig(
temperature=self.config.temperature,
max_output_tokens=self.config.max_tokens,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
asyncio
google-genai==0.2.2
google-genai==0.3.0

0 comments on commit 349353c

Please sign in to comment.