Skip to content

Export type aliases for tool call types #805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,19 @@
ModelResponse,
ReasoningItem,
RunItem,
TImageGenerationCall,
TLocalShellCall,
TMcpCall,
ToolCallItem,
ToolCallOutputItem,
TResponseCodeInterpreterToolCall,
TResponseComputerToolCall,
TResponseFileSearchToolCall,
TResponseFunctionToolCall,
TResponseFunctionWebSearch,
TResponseInputItem,
TResponseOutputItem,
TResponseStreamEvent,
)
from .lifecycle import AgentHooks, RunHooks
from .model_settings import ModelSettings
Expand Down Expand Up @@ -201,6 +211,16 @@ def enable_verbose_stdout_logging():
"ReasoningItem",
"ModelResponse",
"ItemHelpers",
"TResponseOutputItem",
"TResponseStreamEvent",
"TLocalShellCall",
"TMcpCall",
"TResponseCodeInterpreterToolCall",
"TResponseComputerToolCall",
"TResponseFileSearchToolCall",
"TResponseFunctionToolCall",
"TResponseFunctionWebSearch",
"TImageGenerationCall",
"RunHooks",
"AgentHooks",
"RunContextWrapper",
Expand Down
25 changes: 25 additions & 0 deletions src/agents/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,31 @@
TResponseStreamEvent = ResponseStreamEvent
"""A type alias for the ResponseStreamEvent type from the OpenAI SDK."""

# Tool call type aliases
TLocalShellCall = LocalShellCall
"""A type alias for the LocalShellCall type from the OpenAI SDK."""

TMcpCall = McpCall
"""A type alias for the McpCall type from the OpenAI SDK."""

TResponseCodeInterpreterToolCall = ResponseCodeInterpreterToolCall
"""A type alias for the ResponseCodeInterpreterToolCall type from the OpenAI SDK."""

TResponseComputerToolCall = ResponseComputerToolCall
"""A type alias for the ResponseComputerToolCall type from the OpenAI SDK."""

TResponseFileSearchToolCall = ResponseFileSearchToolCall
"""A type alias for the ResponseFileSearchToolCall type from the OpenAI SDK."""

TResponseFunctionToolCall = ResponseFunctionToolCall
"""A type alias for the ResponseFunctionToolCall type from the OpenAI SDK."""

TResponseFunctionWebSearch = ResponseFunctionWebSearch
"""A type alias for the ResponseFunctionWebSearch type from the OpenAI SDK."""

TImageGenerationCall = ImageGenerationCall
"""A type alias for the ImageGenerationCall type from the OpenAI SDK."""

T = TypeVar("T", bound=Union[TResponseOutputItem, TResponseInputItem])


Expand Down