Skip to content

Commit

Permalink
Merge pull request #949 from imsakg/main
Browse files Browse the repository at this point in the history
fix(examples): correct TTS service import and setup
  • Loading branch information
vipyne authored Jan 10, 2025
2 parents a3e2e06 + 67af4e6 commit 5cd9dab
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 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 @@ -53,10 +56,16 @@ async def main():
llm = GeminiMultimodalLiveLLMService(
api_key=os.getenv("GOOGLE_API_KEY"),
# system_instruction="Talk like a pirate."
transcribe_user_audio=True,
transcribe_model_audio=True,
)
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"), voice_id="79a125e8-cd45-4c13-8a67-188112f4dd22"
)

pipeline = Pipeline(
[
Expand Down

0 comments on commit 5cd9dab

Please sign in to comment.