A second pass over the low-error-count files in the ignore list. Drops
10 files (77 → 67) and full-pyright errors from 580 → 555. Default
pyright stays clean.
Three coherent shapes plus a handful of one-offs:
`Language | str | None` → `Language | None` at STT frame boundaries.
`assert_given(self._settings.language)` returns `Language | str | None`
(strips `_NotGiven`, keeps the rest), but `TranscriptionFrame.language`
expects `Language | None`. In practice both `_settings.language` and
SDK-supplied codes resolve to a `Language` enum value, but technically
they could be raw strings — and `Language` is a StrEnum, so downstream
consumers (which mostly compare/serialize as strings) handle either.
Used `cast("Language | None", ...)` at each call site rather than a
runtime-validating helper, so an unrecognised code (e.g. one we
haven't added to the enum yet) still flows through unchanged. Cleared
azure/stt.py, aws/stt.py, gradium/stt.py; mistral/stt.py keeps the
cast at the SDK boundary (storing under `_detected_language: Language
| None`) but stays in the ignore list because of two unrelated
Optional-access errors.
aiobotocore `async with` stub gap. `aioboto3.Session().client(...)`
is an async context manager at runtime but its stubs don't advertise
`__aenter__`/`__aexit__` to pyright. Scoped
`# pyright: ignore[reportGeneralTypeIssues]` on the two affected
sites: aws/agent_core.py and aws/tts.py. aws/tts.py also had a latent
bug on the no-`AudioStream` path: the original code set
`audio_data = None` and then crashed in `resample(...)` and
`len(audio_data)` below; replaced with an early `return` after
logging — matches the convention elsewhere (OpenAI TTS, etc.) of not
recording usage metrics on the error path.
heygen `event_id: str | None` → `str` at transport→client boundary.
Three call sites in transports/heygen/transport.py passed `self._event_id`
(`str | None`) into client methods that take `str`. Added a guard at
each: `agent_speak_end` and `interrupt` only fire when `_event_id` is
set; `write_audio_frame` warn-and-drops when there's no active bot
event rather than sending a malformed message.
`OpenAIResponsesLLMInvocationParams` TypedDict.
`get_llm_invocation_params` always sets both `input` and `tools` in
the same dict literal, but the TypedDict was `total=False` so direct
subscript access (`invocation_params["input"]`) tripped
`reportTypedDictNotRequiredAccess` in services/openai/responses/llm.py.
Marked both keys `Required[...]`; `instructions` stays non-required
since it's only added when a system instruction is present.
Latent bug in heygen/api_interactive_avatar.py: the code accessed
`request_data.voice.voiceId` and `request_data.voice.elevenlabsSettings`,
but those names are Pydantic *aliases*; the actual attribute names
(used for attribute access) are `voice_id` and `elevenlabs_settings`.
Switched to the field names — those camelCase accesses would have
raised AttributeError at runtime if `voice` was set.
Other small fixes:
- assemblyai/stt.py: the deprecated `connection_params=` init path
was reading `formatted_finals` and `word_finalization_max_wait_time`
off `AssemblyAIConnectionParams`, but those fields were never on
the deprecated input model — they were added to Settings later.
Removed the reads (with a comment noting they're only available
via the canonical `settings=...` API); the deprecated input model
is unchanged.
- rtvi/processor.py: two `about: Mapping[str, Any] = None` parameter
signatures — declared `Mapping`, defaulted to `None`, and both
function bodies already handled the None case. Widened to
`Mapping[str, Any] | None = None`.
- aws/stt.py: `subprotocols=["mqtt"]` failed against websockets'
`Sequence[Subprotocol] | None` (Subprotocol is a NewType wrapper).
Wrapped: `subprotocols=[Subprotocol("mqtt")]`.
Files dropped from the ignore list (77 → 67):
processors/frameworks/rtvi/processor.py, services/assemblyai/stt.py,
services/aws/agent_core.py, services/aws/stt.py, services/aws/tts.py,
services/azure/stt.py, services/gradium/stt.py,
services/heygen/api_interactive_avatar.py,
services/openai/responses/llm.py, transports/heygen/transport.py.
78 lines
3.4 KiB
JSON
78 lines
3.4 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/strands_agents.py",
|
|
"src/pipecat/services/anthropic/llm.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/utils.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/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/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/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
|
|
}
|