useResponsesAPI method
Enables the new Responses API instead of Chat Completions API
The Responses API combines the simplicity of Chat Completions with the tool-use capabilities of the Assistants API. It supports built-in tools like web search, file search, and computer use.
Example:
final provider = await ai()
.openai((openai) => openai
.useResponsesAPI()
.webSearchTool())
.apiKey(apiKey)
.model('gpt-4o')
.build();
Implementation
OpenAIBuilder useResponsesAPI([bool use = true]) {
_baseBuilder.extension('useResponsesAPI', use);
return this;
}