processors(rtvi): change voice before LLM updates
This commit is contained in:
@@ -429,15 +429,16 @@ class RTVIProcessor(FrameProcessor):
|
|||||||
await self.push_frame(frame)
|
await self.push_frame(frame)
|
||||||
|
|
||||||
async def _handle_config_update(self, config: RTVIConfig):
|
async def _handle_config_update(self, config: RTVIConfig):
|
||||||
|
# Change voice before LLM updates, so we can hear the new vocie.
|
||||||
|
if config.tts and config.tts.voice:
|
||||||
|
frame = TTSVoiceUpdateFrame(config.tts.voice)
|
||||||
|
await self.push_frame(frame)
|
||||||
if config.llm and config.llm.model:
|
if config.llm and config.llm.model:
|
||||||
frame = LLMModelUpdateFrame(config.llm.model)
|
frame = LLMModelUpdateFrame(config.llm.model)
|
||||||
await self.push_frame(frame)
|
await self.push_frame(frame)
|
||||||
if config.llm and config.llm.messages:
|
if config.llm and config.llm.messages:
|
||||||
frame = LLMMessagesUpdateFrame(config.llm.messages)
|
frame = LLMMessagesUpdateFrame(config.llm.messages)
|
||||||
await self.push_frame(frame)
|
await self.push_frame(frame)
|
||||||
if config.tts and config.tts.voice:
|
|
||||||
frame = TTSVoiceUpdateFrame(config.tts.voice)
|
|
||||||
await self.push_frame(frame)
|
|
||||||
|
|
||||||
async def _handle_llm_get_context(self):
|
async def _handle_llm_get_context(self):
|
||||||
data = RTVILLMContextMessageData(messages=self._tma_in.messages)
|
data = RTVILLMContextMessageData(messages=self._tma_in.messages)
|
||||||
|
|||||||
Reference in New Issue
Block a user