diff --git a/pyrightconfig.json b/pyrightconfig.json index 0a019fc4f..d087425bf 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -2,14 +2,8 @@ "typeCheckingMode": "basic", "pythonVersion": "3.11", "pythonPlatform": "All", - "include": [ - "scripts", - "src/pipecat" - ], - "exclude": [ - "**/*_pb2.py", - "**/__pycache__" - ], + "include": ["scripts", "src/pipecat"], + "exclude": ["**/*_pb2.py", "**/__pycache__"], "ignore": [ "tests", "src/pipecat/adapters/base_llm_adapter.py", @@ -40,7 +34,6 @@ "src/pipecat/processors/frameworks/rtvi/processor.py", "src/pipecat/processors/frameworks/strands_agents.py", "src/pipecat/processors/gstreamer/pipeline_source.py", - "src/pipecat/services/ai_service.py", "src/pipecat/services/anthropic/llm.py", "src/pipecat/services/assemblyai/stt.py", "src/pipecat/services/asyncai/tts.py", @@ -106,7 +99,6 @@ "src/pipecat/services/resembleai/tts.py", "src/pipecat/services/rime/tts.py", "src/pipecat/services/sambanova/llm.py", - "src/pipecat/services/sarvam/llm.py", "src/pipecat/services/sarvam/stt.py", "src/pipecat/services/sarvam/tts.py", "src/pipecat/services/simli/video.py", @@ -138,4 +130,4 @@ "src/pipecat/transports/whatsapp/client.py" ], "reportMissingImports": false -} \ No newline at end of file +} diff --git a/src/pipecat/services/ai_service.py b/src/pipecat/services/ai_service.py index 5d914dd00..6e4064976 100644 --- a/src/pipecat/services/ai_service.py +++ b/src/pipecat/services/ai_service.py @@ -66,8 +66,9 @@ class AIService(FrameProcessor): Args: model: The name of the AI model to use. """ + model = self._settings.model self.set_core_metrics_data( - MetricsData(processor=self.name, model=self._settings.model or "") + MetricsData(processor=self.name, model=model if isinstance(model, str) else "") ) async def start(self, frame: StartFrame): diff --git a/src/pipecat/services/sarvam/llm.py b/src/pipecat/services/sarvam/llm.py index d86ba1874..224b2da43 100644 --- a/src/pipecat/services/sarvam/llm.py +++ b/src/pipecat/services/sarvam/llm.py @@ -83,7 +83,10 @@ class SarvamLLMService(OpenAILLMService): if settings is not None: default_settings.apply_update(settings) - self._validate_model(default_settings.model) + model = default_settings.model + if not isinstance(model, str): + raise ValueError("Sarvam LLM requires a non-empty model string.") + self._validate_model(model) super().__init__( api_key=api_key,