File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11import asyncio
22from dataclasses import dataclass , field , fields
3- from typing import Any , Optional
3+ from typing import Any , Optional , Union
44
55from openai .types .responses import ResponseFunctionToolCall
66
@@ -25,13 +25,21 @@ class ToolContext(RunContextWrapper[TContext]):
2525 tool_call_id : str = field (default_factory = _assert_must_pass_tool_call_id )
2626 """The ID of the tool call."""
2727
28- _event_queue : asyncio .Queue [Any ] | None = field (default = None , init = False , repr = False )
28+ _event_queue : Optional [asyncio .Queue [Any ]] = field (default = None , init = False , repr = False )
29+
30+ @property
31+ def event_queue (self ) -> Optional [asyncio .Queue [Any ]]:
32+ return self ._event_queue
33+
34+ @event_queue .setter
35+ def event_queue (self , queue : Optional [asyncio .Queue [Any ]]) -> None :
36+ self ._event_queue = queue
2937
3038 @classmethod
3139 def from_agent_context (
3240 cls ,
3341 context : RunContextWrapper [TContext ],
34- tool_call_id : str | int ,
42+ tool_call_id : Union [ str , int ] ,
3543 tool_call : Optional [ResponseFunctionToolCall ] = None ,
3644 ) -> "ToolContext" :
3745 """
You can’t perform that action at this time.
0 commit comments