Response

data class Response(val metadata: Map<String, String>?, val temperature: Double? = 1.0, val topP: Double? = 1.0, val model: String, val instructions: String?, val tools: List<Tool> = emptyList(), val toolChoice: String = "auto", val id: String, val objectType: String = "response", val createdAt: Long, val output: List<OutputMessage>, val parallelToolCalls: Boolean = true, val user: String? = null, val previousResponseId: String? = null, val reasoning: Reasoning? = null, val maxOutputTokens: Int? = null, val truncation: Truncation? = Truncation.DISABLED, val status: Response.Status? = null, val outputText: String? = null, val text: TextConfig? = null, val store: Boolean? = null, val incompleteDetails: IncompleteDetails? = null, val usage: Usage, val error: ResponseError? = null) : Record(source)

Represents a response from the OpenAI API.

Author

Konstantin Pavlov

Constructors

Link copied to clipboard
constructor(metadata: Map<String, String>?, temperature: Double? = 1.0, topP: Double? = 1.0, model: String, instructions: String?, tools: List<Tool> = emptyList(), toolChoice: String = "auto", id: String, objectType: String = "response", createdAt: Long, output: List<OutputMessage>, parallelToolCalls: Boolean = true, user: String? = null, previousResponseId: String? = null, reasoning: Reasoning? = null, maxOutputTokens: Int? = null, truncation: Truncation? = Truncation.DISABLED, status: Response.Status? = null, outputText: String? = null, text: TextConfig? = null, store: Boolean? = null, incompleteDetails: IncompleteDetails? = null, usage: Usage, error: ResponseError? = null)

Types

Link copied to clipboard

The status of the response generation.

Properties

Link copied to clipboard
@SerialName(value = "created_at")
val createdAt: Long

The timestamp when the response was created.

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "id")
val id: String

The unique identifier for the response.

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "instructions")
val instructions: String?

The instructions provided to the model.

Link copied to clipboard
@SerialName(value = "max_output_tokens")
val maxOutputTokens: Int?

Optional maximum number of tokens generated.

Link copied to clipboard
@SerialName(value = "metadata")
val metadata: Map<String, String>?

Metadata for the response.

Link copied to clipboard
@SerialName(value = "model")
val model: String

The model used for generating the response.

Link copied to clipboard

The type of the object, always "response".

Link copied to clipboard
@SerialName(value = "output")
val output: List<OutputMessage>

The output content generated by the model.

Link copied to clipboard
@SerialName(value = "output_text")
val outputText: String?

Optional convenience property with aggregated text output.

Link copied to clipboard
@SerialName(value = "parallel_tool_calls")
val parallelToolCalls: Boolean

Whether parallel tool calls were allowed.

Link copied to clipboard
@SerialName(value = "previous_response_id")
val previousResponseId: String?

Optional ID of the previous response.

Link copied to clipboard

Optional reasoning information.

Link copied to clipboard

The status of the response generation.

Link copied to clipboard

Whether the response is stored.

Link copied to clipboard
@SerialName(value = "temperature")
val temperature: Double?

The temperature used for generating the response.

Link copied to clipboard

Optional text configuration for the response.

Link copied to clipboard
@SerialName(value = "tool_choice")
val toolChoice: String

The tool choice configuration.

Link copied to clipboard
@SerialName(value = "tools")
val tools: List<Tool>

The tools available to the model.

Link copied to clipboard
@SerialName(value = "top_p")
val topP: Double?

The top_p value used for generating the response.

Link copied to clipboard

Optional truncation strategy used.

Link copied to clipboard
@SerialName(value = "usage")
val usage: Usage
Link copied to clipboard

Optional user identifier.