Language

VoiceResponse Class

Definition

A persisted voice response representing one model inference turn within a conversation. In list results the output projection may be omitted; retrieve the full response (GET .../responses/{response_id}) or the paged response-items route (GET .../responses/{response_id}/items) for its output items. created_at/completed_at are Foundry durable ordering extensions.

public class VoiceResponse : Azure.AI.Projects.Agents.VoiceResponseBase, System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.Agents.VoiceResponse>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.Agents.VoiceResponse>
type VoiceResponse = class
    inherit VoiceResponseBase
    interface IJsonModel<VoiceResponse>
    interface IPersistableModel<VoiceResponse>
Public Class VoiceResponse
Inherits VoiceResponseBase
Implements IJsonModel(Of VoiceResponse), IPersistableModel(Of VoiceResponse)
Inheritance
VoiceResponse
Implements

Properties

Name Description
Audio

The audio configuration used for the response, including the voice and audio format used for output.

CompletedOn

The Unix timestamp (in seconds) for when the response completed.

ConversationId

The id of the conversation this response belongs to.

CreatedOn

The Unix timestamp (in seconds) for when the response was created.

Id

The unique id of the response.

MaxOutputTokens

Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

<remarks> Supported types:

</remarks>

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

(Inherited from VoiceResponseBase)
Metadata

A set of key-value pairs attached to the response.

Object

The object type, must be realtime.response.

(Inherited from VoiceResponseBase)
Output

The output items produced by the response. May be omitted in list results; retrieve the full response (GET .../responses/{response_id}) or use the paged response-items route (GET .../responses/{response_id}/items) for its output items. Each item's response_id also links it back to this response in the conversation-level items list.

OutputModalities

The set of modalities the model used to respond, currently the only possible values are [\"audio\"], [\"text\"]. Audio output always include a text transcript. Setting the output to mode text will disable audio output from the model.

(Inherited from VoiceResponseBase)
Status

The final status of the response (completed, cancelled, failed, or incomplete, in_progress).

(Inherited from VoiceResponseBase)
StatusDetails

Additional details about the status.

(Inherited from VoiceResponseBase)
Temperature

The sampling temperature used for the response.

Usage

Usage statistics for the Response, this will correspond to billing. A Realtime API session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns.

(Inherited from VoiceResponseBase)

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Operators

Name Description
Explicit(ClientResult to VoiceResponse)

Explicit Interface Implementations

Name Description
IJsonModel<VoiceResponse>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<VoiceResponse>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IJsonModel<VoiceResponseBase>.Create(Utf8JsonReader, ModelReaderWriterOptions) (Inherited from VoiceResponseBase)
IJsonModel<VoiceResponseBase>.Write(Utf8JsonWriter, ModelReaderWriterOptions) (Inherited from VoiceResponseBase)
IPersistableModel<VoiceResponse>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<VoiceResponse>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<VoiceResponse>.Write(ModelReaderWriterOptions)
IPersistableModel<VoiceResponseBase>.Create(BinaryData, ModelReaderWriterOptions) (Inherited from VoiceResponseBase)
IPersistableModel<VoiceResponseBase>.GetFormatFromOptions(ModelReaderWriterOptions) (Inherited from VoiceResponseBase)
IPersistableModel<VoiceResponseBase>.Write(ModelReaderWriterOptions) (Inherited from VoiceResponseBase)

Applies to