feat(gemini): add text handling to GeminiMultimodalLive

- Introduce text attribute in Part class for handling string data.
- Incorporate text processing in GeminiMultimodalLiveLLMService to push TextFrame if text is present.
This commit is contained in:
Mert Sefa AKGUN
2025-01-06 18:05:31 +03:00
parent 8057fe3fcf
commit 5cbd719780
2 changed files with 6 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ class InlineData(BaseModel):
class Part(BaseModel):
inlineData: Optional[InlineData] = None
text: Optional[str] = None
class ModelTurn(BaseModel):

View File

@@ -604,6 +604,11 @@ class GeminiMultimodalLiveLLMService(LLMService):
part = evt.serverContent.modelTurn.parts[0]
if not part:
return
text = part.text
if text:
await self.push_frame(TextFrame(text=text))
inline_data = part.inlineData
if not inline_data:
return