Class HostedToolChoice
Only for Responses API.
Indicates that the model should use a built-in tool to generate a response.
Learn more about built-in tools: https://platform.openai.com/docs/guides/tools
Allowed types (2025-09-21):
- file_search
- web_search_preview
- computer_use_preview
- code_interpreter
- image_generation
public class HostedToolChoice : ToolChoice
- Inheritance
-
objectHostedToolChoice
- Inherited Members
Constructors
HostedToolChoice(string)
public HostedToolChoice(string type)
Parameters
typestring
Properties
Type
public override string Type { get; }
Property Value
- string
Methods
CodeInterpreter()
public static HostedToolChoice CodeInterpreter()
Returns
ComputerUse()
public static HostedToolChoice ComputerUse()
Returns
FileSearch()
public static HostedToolChoice FileSearch()
Returns
ImageGeneration()
public static HostedToolChoice ImageGeneration()
Returns
WebSearchPreview()
public static HostedToolChoice WebSearchPreview()