Interface HostedTool
- All Known Implementing Classes:
HostedTool.CodeInterpreter,HostedTool.FileSearch,HostedTool.ImageGeneration,HostedTool.Mcp,HostedTool.Raw,HostedTool.WebSearch
public sealed interface HostedTool
permits HostedTool.WebSearch, HostedTool.FileSearch, HostedTool.CodeInterpreter, HostedTool.Mcp, HostedTool.ImageGeneration, HostedTool.Raw
A tool that OpenAI executes server-side, inside the same request that generates the
response.
Hosted tools are not ToolCallbacks:
there is nothing for the application to run, and their calls are never surfaced as
tool calls -
they appear in the turn transcript and, summarized, under
OpenAiResponsesMetadata.HOSTED_TOOL_CALLS on the generation metadata.
HostedTool.Raw is the escape hatch for tools OpenAI ships before Spring AI types them.
- Since:
- 2.1.0
- Author:
- Dimitar Proynov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordRun Python in a sandboxed container.static final recordSearch vector stores hosted at OpenAI.static final recordGenerate images.static final recordCall tools on a remote MCP server from inside OpenAI's request.static final recordA tool declared as the raw request JSON, for tools this class does not type yet.static final recordSearch the public web. -
Method Summary
Modifier and TypeMethodDescriptioncom.openai.models.responses.TooltoTool()Convert this tool to the SDK request representation.
-
Method Details
-
toTool
com.openai.models.responses.Tool toTool()Convert this tool to the SDK request representation.
-