OpenAIResponsesRequestBuilder

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Whether to run the request in the background.

Link copied to clipboard

Upper bound for tokens generated in the response.

Link copied to clipboard

Maximum number of tool calls allowed.

Link copied to clipboard

Metadata attached to the request.

Link copied to clipboard

Whether the model can run tool calls in parallel.

Link copied to clipboard

The ID of the previous response to chain from (multi-turn conversation state).

Link copied to clipboard

A cache key used to route the request for prompt caching.

Link copied to clipboard

Reasoning configuration.

Link copied to clipboard

The format the model must output. Combined with verbosity into the text parameter.

Link copied to clipboard

A stable identifier used for safety/abuse tracking.

Link copied to clipboard

Specifies the processing type used for serving the request.

Link copied to clipboard

Whether to store the response for later retrieval.

Link copied to clipboard

Sampling temperature (0.0–2.0).

Link copied to clipboard

Which (if any) tool the model is forced to call.

Link copied to clipboard

Registered tools available to the model.

Link copied to clipboard
var topP: Double?

Nucleus sampling parameter (0.0–1.0).

Link copied to clipboard

The truncation strategy for the context window.

Link copied to clipboard
var user: String?

A stable identifier for end-users.

Link copied to clipboard

Constrains the verbosity of the model's response. Combined with responseFormat into the text parameter.

Functions

Link copied to clipboard

Sets the input using a builder DSL.

Sets the input as a list of input items.

Link copied to clipboard
fun inputText(text: String)

Sets the input as a plain text string.

Link copied to clipboard

Registers tools using a DSL.

Registers a collection of tools.

fun registerTools(vararg tools: OpenAIResponsesTool<*>)

Registers one or more tools.

Link copied to clipboard
fun setInstructions(instructions: String)

Sets the system instructions for the request. Blank strings are ignored.

Link copied to clipboard
fun toolExecutionConfig(toolExecutionConfig: ToolExecutionConfig)

Sets the tool execution config.

fun toolExecutionConfig(autoExecute: Boolean = true, returnErrorsToAI: Boolean = true, maxConcurrency: Int = 5, executionDispatcher: CoroutineDispatcher = Dispatchers.IO, onToolCall: ToolExecutionCallback? = null)

Sets the tool execution config with individual parameters.