Merge pull request #1555 from pipecat-ai/mb/gemini-beta-base
This commit is contained in:
@@ -29,6 +29,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
type was incorrectly handled as a codec retransmission.
|
type was incorrectly handled as a codec retransmission.
|
||||||
- Avoid initial video delays.
|
- Avoid initial video delays.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated `GeminiMultimodalLiveLLMService`’s default `model` to
|
||||||
|
`models/gemini-2.0-flash-live-001` and `base_url` to the `v1beta` websocket
|
||||||
|
URL.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed an issue in the Azure TTS services where the language was being set
|
- Fixed an issue in the Azure TTS services where the language was being set
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class GeminiMultimodalLiveLLMService(LLMService):
|
|||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
base_url: str = "",
|
base_url: str = "generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent",
|
||||||
model="models/gemini-2.0-flash-live-001",
|
model="models/gemini-2.0-flash-live-001",
|
||||||
voice_id: str = "Charon",
|
voice_id: str = "Charon",
|
||||||
start_audio_paused: bool = False,
|
start_audio_paused: bool = False,
|
||||||
@@ -179,11 +179,8 @@ class GeminiMultimodalLiveLLMService(LLMService):
|
|||||||
):
|
):
|
||||||
super().__init__(base_url=base_url, **kwargs)
|
super().__init__(base_url=base_url, **kwargs)
|
||||||
self._last_sent_time = 0
|
self._last_sent_time = 0
|
||||||
self.api_key = api_key
|
self._api_key = api_key
|
||||||
if base_url:
|
self._base_url = base_url
|
||||||
self.base_url = base_url
|
|
||||||
else:
|
|
||||||
self.base_url = "generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent"
|
|
||||||
self.set_model_name(model)
|
self.set_model_name(model)
|
||||||
self._voice_id = voice_id
|
self._voice_id = voice_id
|
||||||
|
|
||||||
@@ -410,8 +407,8 @@ class GeminiMultimodalLiveLLMService(LLMService):
|
|||||||
|
|
||||||
logger.info("Connecting to Gemini service")
|
logger.info("Connecting to Gemini service")
|
||||||
try:
|
try:
|
||||||
logger.info(f"Connecting to wss://{self.base_url}")
|
logger.info(f"Connecting to wss://{self._base_url}")
|
||||||
uri = f"wss://{self.base_url}?key={self.api_key}"
|
uri = f"wss://{self._base_url}?key={self._api_key}"
|
||||||
self._websocket = await websockets.connect(uri=uri)
|
self._websocket = await websockets.connect(uri=uri)
|
||||||
self._receive_task = self.create_task(self._receive_task_handler())
|
self._receive_task = self.create_task(self._receive_task_handler())
|
||||||
self._transcribe_audio_task = self.create_task(self._transcribe_audio_handler())
|
self._transcribe_audio_task = self.create_task(self._transcribe_audio_handler())
|
||||||
|
|||||||
Reference in New Issue
Block a user