Several adjacent fix shapes that together drop 19 files from the pyrightconfig.json ignore list (96 → 77) and full-pyright errors from 605 → 580. Default pyright stays clean. TTS voice/context_id None handling — most files in this batch had a single error of the shape "value typed `T | None` passed where `T` is required" coming out of `assert_given(self._settings.voice)` (which strips `_NotGiven` but not `None`) or `get_active_audio_context_id()`. Two patterns: - For services where a missing voice means the request can't proceed (hume, openai, xtts, groq, kokoro, piper), added an explicit None check. Inside `run_tts` we yield an `ErrorFrame` and return — matching each service's existing error-emission style (a few wrap `Exception` broadly and were fine; openai/hume/xtts had narrower or no try blocks so a bare `raise ValueError` would have escaped uncaught). Piper validates in `__init__`, where failing fast at construction is the right shape. OpenAI also gained a `voice not in VALID_VOICES` guard with a clear message listing supported voices. - For services where a missing audio context just means "skip this message" (fish, lmnt, smallest, sarvam, neuphonic), widened `TTSService.append_to_audio_context`'s `context_id` signature to `str | None`. The function body already explicitly handled the None case with a debug log + early return, so the prior `str` annotation was a lie; making it honest cleared call sites without local guards. inworld's `_close_context` got the same treatment. google.genai imports — switched `from google import genai` to `import google.genai as genai` in google/image.py and google/llm.py. The dotted form sidesteps a PEP 420 namespace-package stub gap (the `google` namespace stubs come from a different distribution and don't declare `genai`), which means pyright now resolves `genai` to the real module rather than `Unknown`. IDE autocomplete on `genai.<x>` works for the first time. In image.py this surfaced three latent bugs that the `Unknown` resolution had been hiding (model was `str | _NotGiven | None` not narrowed before passing to the SDK; two spots accessed `.image_bytes` on an `Image | None` without a guard) — all fixed. llm.py's dotted import surfaced 8 errors (Content-list typing nuances, internal `_api_client` access, a few small Optionals); deferred to a future pass since they're outside this commit's scope, so the file stays in the ignore list with the dotted import. Latent bug fixes spotted along the way: - resembleai/tts.py was calling `push_error(ErrorFrame(...))`, but `push_error` takes a string — there's a separate `push_error_frame` for the frame case. Switched to the right method. - openai/base_llm.py: `max_completion_tokens` was the only sibling field on `OpenAILLMSettings` missing `| None` in its type, which caused the assignment in openai/llm.py from `params.max_completion_tokens` (`int | None`) to fail. Added `| None` for consistency with `max_tokens` etc. - heygen/base_api.py: `livekit_url: str = None` and `ws_url: str = None` declared `str` while defaulting to `None`. Removed the bogus defaults — both fields are required at construction in every in-tree call site, and the previous `str = None` was a Pydantic footgun. Other small ones: gladia/stt.py needed a None guard on `_session_url` before `websocket_connect`; openrouter/llm.py's `build_chat_completion_params` override widened to `dict[str, Any]` diverging from the parent's `OpenAILLMInvocationParams` — restored the parent's type; neuphonic/tts.py guarded the receive loop's `async for message in self._websocket` with a local-variable narrowing matching the pattern from 9e9b1f39e. groq/tts.py: tightened `output_format`'s typing to `Literal["flac","mp3","mulaw","ogg","wav"] | str = "wav"`. The literal side gives IDE autocomplete hints for the currently-supported set; the `| str` side keeps callers unblocked if groq adds a new format before this list is updated. A `cast` at the API boundary satisfies groq's stricter `Literal` parameter type. The literal alias mirrors the inlined Literal on `groq.resources.audio.speech.AsyncSpeech.create`'s `response_format` (the SDK doesn't export it as a named symbol). websocket_service.py: scoped `# pyright: ignore[reportAttributeAccessIssue]` on `websockets.WebSocketClientProtocol`. That alias is now a deprecated re-export from the legacy submodule and pyright doesn't surface it on the top-level `websockets` namespace; runtime is fine. Migrating to `websockets.ClientConnection` is a separate piece of work (transports/websocket/client.py uses the same alias four times) and left for a future commit. Files dropped from the ignore list: fish/tts.py, gladia/stt.py, google/image.py, groq/tts.py, heygen/base_api.py, hume/tts.py, inworld/tts.py, kokoro/tts.py, lmnt/tts.py, neuphonic/tts.py, openai/llm.py, openai/tts.py, openrouter/llm.py, piper/tts.py, resembleai/tts.py, sarvam/tts.py, smallest/tts.py, websocket_service.py, xtts/tts.py.
88 lines
3.8 KiB
JSON
88 lines
3.8 KiB
JSON
{
|
|
"typeCheckingMode": "basic",
|
|
"pythonVersion": "3.11",
|
|
"pythonPlatform": "All",
|
|
"include": ["scripts", "src/pipecat"],
|
|
"exclude": ["**/*_pb2.py", "**/__pycache__"],
|
|
"ignore": [
|
|
"tests",
|
|
"src/pipecat/audio/dtmf/utils.py",
|
|
"src/pipecat/audio/filters/aic_filter.py",
|
|
"src/pipecat/audio/filters/krisp_viva_filter.py",
|
|
"src/pipecat/audio/filters/rnnoise_filter.py",
|
|
"src/pipecat/audio/turn/smart_turn/local_smart_turn_v2.py",
|
|
"src/pipecat/audio/turn/smart_turn/local_smart_turn_v3.py",
|
|
"src/pipecat/audio/vad/silero.py",
|
|
"src/pipecat/processors/aggregators/llm_response_universal.py",
|
|
"src/pipecat/processors/frame_processor.py",
|
|
"src/pipecat/processors/frameworks/langchain.py",
|
|
"src/pipecat/processors/frameworks/rtvi/observer.py",
|
|
"src/pipecat/processors/frameworks/rtvi/processor.py",
|
|
"src/pipecat/processors/frameworks/strands_agents.py",
|
|
"src/pipecat/services/anthropic/llm.py",
|
|
"src/pipecat/services/assemblyai/stt.py",
|
|
"src/pipecat/services/aws/agent_core.py",
|
|
"src/pipecat/services/aws/llm.py",
|
|
"src/pipecat/services/aws/nova_sonic/llm.py",
|
|
"src/pipecat/services/aws/sagemaker/bidi_client.py",
|
|
"src/pipecat/services/aws/stt.py",
|
|
"src/pipecat/services/aws/tts.py",
|
|
"src/pipecat/services/aws/utils.py",
|
|
"src/pipecat/services/azure/stt.py",
|
|
"src/pipecat/services/azure/tts.py",
|
|
"src/pipecat/services/deepgram/flux/base.py",
|
|
"src/pipecat/services/deepgram/flux/sagemaker/stt.py",
|
|
"src/pipecat/services/deepgram/flux/stt.py",
|
|
"src/pipecat/services/deepgram/sagemaker/stt.py",
|
|
"src/pipecat/services/deepgram/sagemaker/tts.py",
|
|
"src/pipecat/services/deepgram/tts.py",
|
|
"src/pipecat/services/elevenlabs/tts.py",
|
|
"src/pipecat/services/google/gemini_live/llm.py",
|
|
"src/pipecat/services/google/gemini_live/vertex/llm.py",
|
|
"src/pipecat/services/google/llm.py",
|
|
"src/pipecat/services/google/stt.py",
|
|
"src/pipecat/services/google/tts.py",
|
|
"src/pipecat/services/gradium/stt.py",
|
|
"src/pipecat/services/heygen/api_interactive_avatar.py",
|
|
"src/pipecat/services/heygen/client.py",
|
|
"src/pipecat/services/heygen/video.py",
|
|
"src/pipecat/services/inworld/realtime/llm.py",
|
|
"src/pipecat/services/llm_service.py",
|
|
"src/pipecat/services/mem0/memory.py",
|
|
"src/pipecat/services/mistral/stt.py",
|
|
"src/pipecat/services/mistral/tts.py",
|
|
"src/pipecat/services/moondream/vision.py",
|
|
"src/pipecat/services/nvidia/stt.py",
|
|
"src/pipecat/services/nvidia/tts.py",
|
|
"src/pipecat/services/openai/base_llm.py",
|
|
"src/pipecat/services/openai/image.py",
|
|
"src/pipecat/services/openai/realtime/llm.py",
|
|
"src/pipecat/services/openai/responses/llm.py",
|
|
"src/pipecat/services/openai/stt.py",
|
|
"src/pipecat/services/rime/tts.py",
|
|
"src/pipecat/services/sambanova/llm.py",
|
|
"src/pipecat/services/sarvam/stt.py",
|
|
"src/pipecat/services/simli/video.py",
|
|
"src/pipecat/services/speechmatics/stt.py",
|
|
"src/pipecat/services/stt_service.py",
|
|
"src/pipecat/services/tavus/video.py",
|
|
"src/pipecat/services/tts_service.py",
|
|
"src/pipecat/services/ultravox/llm.py",
|
|
"src/pipecat/services/whisper/stt.py",
|
|
"src/pipecat/services/xai/realtime/llm.py",
|
|
"src/pipecat/transports/base_output.py",
|
|
"src/pipecat/transports/daily/transport.py",
|
|
"src/pipecat/transports/heygen/transport.py",
|
|
"src/pipecat/transports/lemonslice/transport.py",
|
|
"src/pipecat/transports/livekit/transport.py",
|
|
"src/pipecat/transports/smallwebrtc/connection.py",
|
|
"src/pipecat/transports/smallwebrtc/request_handler.py",
|
|
"src/pipecat/transports/smallwebrtc/transport.py",
|
|
"src/pipecat/transports/tavus/transport.py",
|
|
"src/pipecat/transports/websocket/client.py",
|
|
"src/pipecat/transports/websocket/server.py",
|
|
"src/pipecat/transports/whatsapp/client.py"
|
|
],
|
|
"reportMissingImports": false
|
|
}
|