mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
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:
parent
e7aea5d0b8
commit
efd1b0dc14
1 changed files with 6 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue