fix(otel): annotate to_openai_dict as Mapping after the rebase onto main

Main's type-discipline budget tightened since the branch point; the plain
dict return annotation is the one violation the rebased branch adds.
Callers only serialize the result, so the read-only view is accurate.
This commit is contained in:
Yucheng He 2026-10-04 03:26:39 -07:00
parent e7aea5d0b8
commit efd1b0dc14

View file

@ -21,7 +21,12 @@ class MessageToolCall:
name: str | None
arguments: str | None
def to_openai_dict(self) -> dict[str, object]:
def to_openai_dict(self) -> Mapping[str, object]:
"""The OpenAI wire shape of this tool call.
The runtime object is a plain dict (it is only ever JSON-serialized);
the ``Mapping`` return type marks it read-only to callers.
"""
return {
"id": self.id,
"type": self.type,