ResponseCreateParams interface

Create a new VoiceLive response with these parameters

Properties

appendInputItems

Input items to append to the conversation context before generating a response.

cancelPrevious

Whether to cancel any ongoing generation before starting this one. Defaults to true.

commit

Whether to commit the response to the conversation. Defaults to true.

inputItems

Input items to be used as the context for this response. An empty array clears previous context.

instructions

The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.

Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session.

interimResponse

Configuration for interim response generation during latency or tool calls.

maxOutputTokens

Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf.

metadata

Set of up to 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

modalities

The set of modalities the model can respond with. To disable audio, set this to ["text"].

outputAudioFormat

The format of output audio. Options are pcm16, g711_ulaw, or g711_alaw.

preGeneratedAssistantMessage

Create the response with pre-generated assistant message. The message item would be added into the conversation history and returned with synthesized audio output in the created response.

reasoningEffort

Constrains effort on reasoning for reasoning models. Check model documentation for supported values for each model. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

temperature

Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.

toolChoice

How the model chooses tools. Options are auto, none, required, or specify a function, like {"type": "function", "function": {"name": "my_function"}}.

tools

Tools (functions) available to the model.

voice

supported voice identifiers and configurations.

Property Details

appendInputItems

Input items to append to the conversation context before generating a response.

appendInputItems?: ConversationRequestItemUnion[]

Property Value

cancelPrevious

Whether to cancel any ongoing generation before starting this one. Defaults to true.

cancelPrevious?: boolean

Property Value

boolean

commit

Whether to commit the response to the conversation. Defaults to true.

commit?: boolean

Property Value

boolean

inputItems

Input items to be used as the context for this response. An empty array clears previous context.

inputItems?: ConversationRequestItemUnion[]

Property Value

instructions

The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.

Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session.

instructions?: string

Property Value

string

interimResponse

Configuration for interim response generation during latency or tool calls.

interimResponse?: InterimResponseConfig

Property Value

maxOutputTokens

Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf.

maxOutputTokens?: number | "inf"

Property Value

number | "inf"

metadata

Set of up to 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

metadata?: Record<string, string>

Property Value

Record<string, string>

modalities

The set of modalities the model can respond with. To disable audio, set this to ["text"].

modalities?: string[]

Property Value

string[]

outputAudioFormat

The format of output audio. Options are pcm16, g711_ulaw, or g711_alaw.

outputAudioFormat?: string

Property Value

string

preGeneratedAssistantMessage

Create the response with pre-generated assistant message. The message item would be added into the conversation history and returned with synthesized audio output in the created response.

preGeneratedAssistantMessage?: AssistantMessageItem

Property Value

reasoningEffort

Constrains effort on reasoning for reasoning models. Check model documentation for supported values for each model. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

reasoningEffort?: string

Property Value

string

temperature

Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.

temperature?: number

Property Value

number

toolChoice

How the model chooses tools. Options are auto, none, required, or specify a function, like {"type": "function", "function": {"name": "my_function"}}.

toolChoice?: string

Property Value

string

tools

Tools (functions) available to the model.

tools?: ToolUnion[]

Property Value

voice

supported voice identifiers and configurations.

voice?: Voice

Property Value