Search Results for

    Show / Hide Table of Contents

    Class RealtimeItem

    A realtime Item is of three types: message, function_call, or function_call_output.

    A message item can contain text or audio.

    A function_call item indicates a model's desire to call a tool.

    A function_call_output item indicates a function response.

    The client may add and remove message and function_call_output Items using conversation.item.create and conversation.item.delete.

    Inheritance
    object
    RealtimeItem
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.OpenAI.Realtime
    Assembly: Glitch9.AIDevKit.Provider.OpenAI.dll
    Syntax
    public class RealtimeItem

    Properties

    | Edit this page View Source

    ApprovalRequestId

    The ID of an associated approval request, if any.

    Declaration
    [JsonProperty("approval_request_id")]
    public string ApprovalRequestId { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Approve

    Whether the request was approved.

    Declaration
    [JsonProperty("approve")]
    public bool? Approve { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    Arguments

    The arguments of the function call (for "function_call" items).

    Declaration
    [JsonProperty("arguments")]
    public string Arguments { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    CallId

    The ID of the function call (for "function_call" items).

    Declaration
    [JsonProperty("call_id")]
    public string CallId { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Content

    The content of the item.

    Declaration
    [JsonProperty("content")]
    public RealtimeItemContent[] Content { get; set; }
    Property Value
    Type Description
    RealtimeItemContent[]
    | Edit this page View Source

    Error

    The error from the MCP tool call, if any.

    Declaration
    [JsonProperty("error")]
    public McpException Error { get; set; }
    Property Value
    Type Description
    McpException
    | Edit this page View Source

    Id

    The unique ID of the item.

    Declaration
    [JsonProperty("id")]
    public string Id { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Name

    The name of the function being called (for "function_call" items).

    Declaration
    [JsonProperty("name")]
    public string Name { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Object

    The object type.

    Declaration
    [JsonProperty("object")]
    public string Object { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Output

    The list of output items generated by the response.

    Declaration
    [JsonProperty("output")]
    public RealtimeItem[] Output { get; set; }
    Property Value
    Type Description
    RealtimeItem[]
    | Edit this page View Source

    Reason

    Optional reason for the decision for approval or rejection.

    Declaration
    [JsonProperty("reason")]
    public string Reason { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Role

    The role associated with the item.

    Declaration
    [JsonProperty("role")]
    public ChatRole? Role { get; set; }
    Property Value
    Type Description
    ChatRole?
    | Edit this page View Source

    ServerLabel

    The label of the MCP server running the tool.

    Declaration
    [JsonProperty("server_label")]
    public string ServerLabel { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Status

    The status of the item.

    Declaration
    [JsonProperty("status")]
    public RealtimeItemStatus? Status { get; set; }
    Property Value
    Type Description
    RealtimeItemStatus?
    | Edit this page View Source

    StatusDetails

    Additional details about the status.

    Declaration
    [JsonProperty("status_details")]
    public RealtimeItemStatusDetails StatusDetails { get; set; }
    Property Value
    Type Description
    RealtimeItemStatusDetails
    | Edit this page View Source

    Tools

    The MCP tools available on the server retrieved by McpToolList call.

    Declaration
    [JsonProperty("tools")]
    public List<McpToolInfo> Tools { get; set; }
    Property Value
    Type Description
    List<McpToolInfo>
    | Edit this page View Source

    Type

    The type of the item.

    Declaration
    [JsonProperty("type")]
    public RealtimeItemType Type { get; set; }
    Property Value
    Type Description
    RealtimeItemType
    | Edit this page View Source

    Usage

    Usage statistics for the response.

    Declaration
    [JsonProperty("usage")]
    public Usage Usage { get; set; }
    Property Value
    Type Description
    Usage

    Methods

    | Edit this page View Source

    AssistantMessage(string)

    Declaration
    public static RealtimeItem AssistantMessage(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    RealtimeItem
    | Edit this page View Source

    AssistantVoice(string, string)

    Declaration
    public static RealtimeItem AssistantVoice(string base64EncodedAudio, string transcript)
    Parameters
    Type Name Description
    string base64EncodedAudio
    string transcript
    Returns
    Type Description
    RealtimeItem
    | Edit this page View Source

    FromMessage(Message)

    Declaration
    public static RealtimeItem FromMessage(Message message)
    Parameters
    Type Name Description
    Message message
    Returns
    Type Description
    RealtimeItem
    | Edit this page View Source

    GetResponseText()

    Declaration
    public string GetResponseText()
    Returns
    Type Description
    string
    | Edit this page View Source

    GetResponseTranscript()

    Declaration
    public string GetResponseTranscript()
    Returns
    Type Description
    string
    | Edit this page View Source

    McpApproval(McpApprovalResponse)

    Declaration
    public static RealtimeItem McpApproval(McpApprovalResponse approval)
    Parameters
    Type Name Description
    McpApprovalResponse approval
    Returns
    Type Description
    RealtimeItem
    | Edit this page View Source

    ToMessage()

    Declaration
    public Message ToMessage()
    Returns
    Type Description
    Message
    | Edit this page View Source

    ToStatusString()

    Declaration
    public string ToStatusString()
    Returns
    Type Description
    string
    | Edit this page View Source

    TruncateAudioAt(long)

    Declaration
    public void TruncateAudioAt(long audioEndMs)
    Parameters
    Type Name Description
    long audioEndMs
    | Edit this page View Source

    UserMessage(string)

    Declaration
    public static RealtimeItem UserMessage(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    RealtimeItem
    | Edit this page View Source

    UserVoice(string)

    Declaration
    public static RealtimeItem UserVoice(string base64EncodedAudio)
    Parameters
    Type Name Description
    string base64EncodedAudio
    Returns
    Type Description
    RealtimeItem

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation