From 5eaf9a78e0ee2143082511fdce3de250f0778093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 23 Sep 2024 23:39:05 -0700 Subject: [PATCH] rtvi: add llm-text and tts-text server messages --- src/pipecat/processors/frameworks/rtvi.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/pipecat/processors/frameworks/rtvi.py b/src/pipecat/processors/frameworks/rtvi.py index 820ea716c..7a35c5c06 100644 --- a/src/pipecat/processors/frameworks/rtvi.py +++ b/src/pipecat/processors/frameworks/rtvi.py @@ -242,6 +242,22 @@ class RTVILLMFunctionCallResultData(BaseModel): result: dict | str +class RTVITextMessageData(BaseModel): + text: str + + +class RTVILLMTextMessage(BaseModel): + label: Literal["rtvi-ai"] = "rtvi-ai" + type: Literal["llm-text"] = "llm-text" + data: RTVITextMessageData + + +class RTVITTSTextMessage(BaseModel): + label: Literal["rtvi-ai"] = "rtvi-ai" + type: Literal["tts-text"] = "tts-text" + data: RTVITextMessageData + + class RTVITranscriptionMessageData(BaseModel): text: str user_id: str