From 696123f2c55ff52c4e9e06e39914a1fa880cdbca Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 19 Mar 2026 09:03:38 -0400 Subject: [PATCH] Update 07z foundational examples to use SarvamLLMService --- examples/foundational/07z-interruptible-sarvam-http.py | 8 ++++---- examples/foundational/07z-interruptible-sarvam.py | 8 ++++---- src/pipecat/services/sarvam/llm.py | 6 +++++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/foundational/07z-interruptible-sarvam-http.py b/examples/foundational/07z-interruptible-sarvam-http.py index f8a806493..09938cf96 100644 --- a/examples/foundational/07z-interruptible-sarvam-http.py +++ b/examples/foundational/07z-interruptible-sarvam-http.py @@ -23,7 +23,7 @@ from pipecat.processors.aggregators.llm_response_universal import ( ) from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.openai.llm import OpenAILLMService +from pipecat.services.sarvam.llm import SarvamLLMService from pipecat.services.sarvam.stt import SarvamSTTService from pipecat.services.sarvam.tts import SarvamHttpTTSService from pipecat.transcriptions.language import Language @@ -72,9 +72,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): ), ) - llm = OpenAILLMService( - api_key=os.getenv("OPENAI_API_KEY"), - settings=OpenAILLMService.Settings( + llm = SarvamLLMService( + api_key=os.getenv("SARVAM_API_KEY"), + settings=SarvamLLMService.Settings( system_instruction="You are a helpful assistant in a voice conversation. Your responses will be spoken aloud, so avoid emojis, bullet points, or other formatting that can't be spoken. Respond to what the user said in a creative, helpful, and brief way.", ), ) diff --git a/examples/foundational/07z-interruptible-sarvam.py b/examples/foundational/07z-interruptible-sarvam.py index 5f144f73f..1782fb2ef 100644 --- a/examples/foundational/07z-interruptible-sarvam.py +++ b/examples/foundational/07z-interruptible-sarvam.py @@ -21,7 +21,7 @@ from pipecat.processors.aggregators.llm_response_universal import ( ) from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.openai.llm import OpenAILLMService +from pipecat.services.sarvam.llm import SarvamLLMService from pipecat.services.sarvam.stt import SarvamSTTService from pipecat.services.sarvam.tts import SarvamTTSService from pipecat.transports.base_transport import BaseTransport, TransportParams @@ -66,9 +66,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): voice="manisha", ), ) - llm = OpenAILLMService( - api_key=os.getenv("OPENAI_API_KEY"), - settings=OpenAILLMService.Settings( + llm = SarvamLLMService( + api_key=os.getenv("SARVAM_API_KEY"), + settings=SarvamLLMService.Settings( system_instruction="You are a helpful assistant in a voice conversation. Your responses will be spoken aloud, so avoid emojis, bullet points, or other formatting that can't be spoken. Respond to what the user said in a creative, helpful, and brief way.", ), ) diff --git a/src/pipecat/services/sarvam/llm.py b/src/pipecat/services/sarvam/llm.py index 893d79ac5..d00d2a5cc 100644 --- a/src/pipecat/services/sarvam/llm.py +++ b/src/pipecat/services/sarvam/llm.py @@ -81,7 +81,11 @@ class SarvamLLMService(OpenAILLMService): **kwargs: Additional keyword arguments passed to ``OpenAILLMService``. """ # Initialize default_settings with hardcoded defaults - default_settings = self.Settings(model="sarvam-30b") + default_settings = self.Settings( + model="sarvam-30b", + wiki_grounding=None, + reasoning_effort=None, + ) # Apply settings delta (canonical API, always wins) if settings is not None: