Skip to content

Commit a7598a4

Browse files
committed
fix: replace Python 3.10 union syntax in ToolContext for 3.9 compatibility
1 parent 1808abd commit a7598a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/agents/tool_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
from dataclasses import dataclass, field, fields
3-
from typing import Any
3+
from typing import Any, Optional
44

55
from .run_context import RunContextWrapper, TContext
66

@@ -16,7 +16,7 @@ class ToolContext(RunContextWrapper[TContext]):
1616
tool_call_id: str = field(default_factory=_assert_must_pass_tool_call_id)
1717
"""The ID of the tool call."""
1818

19-
_event_queue: asyncio.Queue[Any] | None = field(default=None, init=False, repr=False)
19+
_event_queue: Optional[asyncio.Queue[Any]] = field(default=None, init=False, repr=False)
2020

2121
@classmethod
2222
def from_agent_context(

0 commit comments

Comments
 (0)