Class RealtimeResponseResource
public sealed class RealtimeResponseResource
- Inheritance
-
RealtimeResponseResource
- Inherited Members
Properties
ConversationId
Which conversation the response is added to, determined by the conversation
field in the response.create event. If auto, the response will be added to
the default conversation and the value of conversation_id will be an id like
conv_1234. If none, the response will not be added to any conversation and
the value of conversation_id will be null. If responses are being triggered
by server VAD, the response will be added to the default conversation, thus
the conversation_id will be an id like conv_1234.
[JsonInclude]
[JsonPropertyName("conversation_id")]
public string ConversationId { get; }
Property Value
Id
The unique ID of the response.
[JsonInclude]
[JsonPropertyName("id")]
public string Id { get; }
Property Value
MaxOutputTokens
Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.
[JsonInclude]
[JsonPropertyName("max_output_tokens")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public object MaxOutputTokens { get; }
Property Value
Metadata
Set of 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, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
[JsonInclude]
[JsonPropertyName("metadata")]
public IReadOnlyDictionary<string, object> Metadata { get; }
Property Value
Modalities
The set of modalities the model used to respond. If there are multiple modalities,
the model will pick one, for example if modalities is ["text", "audio"], the model
could be responding in either text or audio.
[JsonInclude]
[JsonPropertyName("modalities")]
[JsonConverter(typeof(ModalityConverter))]
public Modality Modalities { get; }
Property Value
Object
The object type, must be "realtime.response".
[JsonInclude]
[JsonPropertyName("object")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string Object { get; }
Property Value
Output
The list of output items generated by the response.
[JsonInclude]
[JsonPropertyName("output")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public IReadOnlyList<ConversationItem> Output { get; }
Property Value
OutputAudioFormat
The format of output audio. Options are pcm16, g711_ulaw, or g711_alaw.
[JsonInclude]
[JsonPropertyName("output_audio_format")]
[JsonConverter(typeof(JsonStringEnumConverter<RealtimeAudioFormat>))]
public RealtimeAudioFormat OutputAudioFormat { get; }
Property Value
Status
The status of the response ("in_progress").
[JsonInclude]
[JsonPropertyName("status")]
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
[JsonConverter(typeof(JsonStringEnumConverter<RealtimeResponseStatus>))]
public RealtimeResponseStatus Status { get; }
Property Value
StatusDetails
Additional details about the status.
[JsonInclude]
[JsonPropertyName("status_details")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public StatusDetails StatusDetails { get; }
Property Value
Temperature
Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
[JsonInclude]
[JsonPropertyName("temperature")]
public float Temperature { get; }
Property Value
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.
[JsonInclude]
[JsonPropertyName("usage")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public TokenUsage Usage { get; }
Property Value
Voice
The voice the model used to respond.
Current voice options are alloy, ash, ballad, coral, echo sage, shimmer and verse.
[JsonInclude]
[JsonPropertyName("voice")]
public string Voice { get; }
Property Value
Methods
PrintUsage()
public void PrintUsage()