Skip to content

Python: tools: Consider using Mapping instead of MutableMapping in tools parameter #3577

@eavanvalkenburg

Description

@eavanvalkenburg

In _agents.py, the tools parameter type hint uses MutableMapping[str, Any] but Mapping might be more appropriate since immutability is not required.

File: python/packages/core/agent_framework/_agents.py
Location: Line ~597

tools: ToolProtocol
    | Callable[..., Any]
    | MutableMapping[str, Any]  # <- Mapping
    | Sequence[ToolProtocol | Callable[..., Any] | MutableMapping[str, Any]]
    | None = None,

Action: Consider changing to Mapping for broader type compatibility.

Parent issue: #3575

Metadata

Metadata

Labels

pythonv1.0Features being tracked for the version 1.0 GA

Type

No fields configured for Task.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions