1313
1414from ..content import AssistantContent , Audio , Image , Thinking , ToolCall
1515from ..messages import Message
16+ from ..tools import Tool
1617from .finish_reason import FinishReason
1718from .usage import Usage
1819
@@ -67,11 +68,11 @@ class Response(Generic[T]):
6768 cost : Decimal | None
6869 """The cost of the request to the LLM, if available."""
6970
70- tools : Sequence [ToolCall ]
71+ tool_calls : Sequence [ToolCall ]
7172 """The tools the LLM wants called on its behalf, if any."""
7273
7374 @property
74- def tool (self ) -> ToolCall | None :
75+ def tool_call (self ) -> ToolCall | None :
7576 """Returns the first tool used in the response, if any."""
7677 raise NotImplementedError ()
7778
@@ -95,6 +96,14 @@ def thinking(self) -> Thinking | None:
9596 """Returns the first thinking in the response content, if any."""
9697 raise NotImplementedError ()
9798
99+ def tool (self , tool_call : ToolCall ) -> Tool :
100+ """Converts a ToolCall into a Tool. May raise llm.ToolNotFoundError."""
101+ raise NotImplementedError ()
102+
103+ def tools (self , tool_calls : list [ToolCall ]) -> list [Tool ]:
104+ """Converts a list of ToolCalls into a list of Tools. May raise llm.ToolNotFoundError."""
105+ raise NotImplementedError ()
106+
98107 def format (self ) -> T :
99108 """Format the response according to the response format parser.
100109
0 commit comments