Skip to content

Commit

Permalink
fix(examples): correct TTS service import and setup
Browse files Browse the repository at this point in the history
- Update import to use CartesiaTTSService instead of CartesiaMultiLingualTTSService.
- Adjust GeminiMultimodalLiveLLMService setup to use set_model_modalities with TEXT modality.
  • Loading branch information
imsakg committed Jan 8, 2025
1 parent 39c6446 commit 7634058
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/foundational/26d-gemini-multimodal-live-text.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import sys

import aiohttp
from agent.services.tts.cartesia_multilingual import CartesiaMultiLingualTTSService
from dotenv import load_dotenv
from loguru import logger
from runner import configure
Expand All @@ -19,7 +18,11 @@
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.services.gemini_multimodal_live.gemini import GeminiMultimodalLiveLLMService
from pipecat.services.cartesia import CartesiaTTSService
from pipecat.services.gemini_multimodal_live.gemini import (
GeminiMultimodalLiveLLMService,
GeminiMultimodalModalities,
)
from pipecat.transports.services.daily import DailyParams, DailyTransport

load_dotenv(override=True)
Expand Down Expand Up @@ -54,9 +57,11 @@ async def main():
api_key=os.getenv("GOOGLE_API_KEY"),
# system_instruction="Talk like a pirate."
)
llm.set_model_only_text() # This forces model to produce text only responses
llm.set_model_modalities(
GeminiMultimodalModalities.TEXT
) # This forces model to produce text only responses

tts = CartesiaMultiLingualTTSService(api_key=os.getenv("CARTESIA_API_KEY"))
tts = CartesiaTTSService(api_key=os.getenv("CARTESIA_API_KEY"))

pipeline = Pipeline(
[
Expand Down

0 comments on commit 7634058

Please sign in to comment.