Widen ToolsSchema.standard_tools to Sequence for covariance
`ToolsSchema.__init__` declared `standard_tools: list[FunctionSchema | DirectFunction]`. Callers (`BaseLLMAdapter`, `MCPService`) pass in `list[FunctionSchema]`, which is not assignable to the union list because `list` is invariant in its element type. Widen the parameter to `Sequence[...]` (covariant) so `list[X]` and `list[X | Y]` both fit. A narrower `list[FunctionSchema]` is still accepted, and nothing in this class mutates the argument — the constructor immediately copies it via `_map_standard_tools`. Also correct the `custom_tools` property return type to include `None`, matching the stored `_custom_tools` field. This single edit clears the pyright errors for three ignore-list entries: `tools_schema.py`, `base_llm_adapter.py`, and `mcp_service.py`.
This commit is contained in:
@@ -6,9 +6,7 @@
|
||||
"exclude": ["**/*_pb2.py", "**/__pycache__"],
|
||||
"ignore": [
|
||||
"tests",
|
||||
"src/pipecat/adapters/base_llm_adapter.py",
|
||||
"src/pipecat/adapters/schemas/direct_function.py",
|
||||
"src/pipecat/adapters/schemas/tools_schema.py",
|
||||
"src/pipecat/adapters/services/anthropic_adapter.py",
|
||||
"src/pipecat/adapters/services/aws_nova_sonic_adapter.py",
|
||||
"src/pipecat/adapters/services/bedrock_adapter.py",
|
||||
@@ -78,7 +76,6 @@
|
||||
"src/pipecat/services/kokoro/tts.py",
|
||||
"src/pipecat/services/llm_service.py",
|
||||
"src/pipecat/services/lmnt/tts.py",
|
||||
"src/pipecat/services/mcp_service.py",
|
||||
"src/pipecat/services/mem0/memory.py",
|
||||
"src/pipecat/services/mistral/llm.py",
|
||||
"src/pipecat/services/mistral/stt.py",
|
||||
|
||||
Reference in New Issue
Block a user