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.

public class RealtimeItem
Inheritance
object
RealtimeItem

Properties

ApprovalRequestId

The ID of an associated approval request, if any.

public string ApprovalRequestId { get; set; }

Property Value

string

Approve

Whether the request was approved.

public bool? Approve { get; set; }

Property Value

bool?

Arguments

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

public string Arguments { get; set; }

Property Value

string

CallId

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

public string CallId { get; set; }

Property Value

string

Content

The content of the item.

public RealtimeItemContent[] Content { get; set; }

Property Value

RealtimeItemContent[]

Error

The error from the MCP tool call, if any.

public McpException Error { get; set; }

Property Value

McpException

Id

The unique ID of the item.

public string Id { get; set; }

Property Value

string

Name

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

public string Name { get; set; }

Property Value

string

Object

The object type.

public string Object { get; set; }

Property Value

string

Output

The list of output items generated by the response.

public RealtimeItem[] Output { get; set; }

Property Value

RealtimeItem[]

Reason

Optional reason for the decision for approval or rejection.

public string Reason { get; set; }

Property Value

string

Role

The role associated with the item.

public ChatRole? Role { get; set; }

Property Value

ChatRole?

ServerLabel

The label of the MCP server running the tool.

public string ServerLabel { get; set; }

Property Value

string

Status

The status of the item.

public RealtimeItemStatus? Status { get; set; }

Property Value

RealtimeItemStatus?

StatusDetails

Additional details about the status.

public RealtimeItemStatusDetails StatusDetails { get; set; }

Property Value

RealtimeItemStatusDetails

Tools

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

public List<McpToolInfo> Tools { get; set; }

Property Value

List<McpToolInfo>

Type

The type of the item.

public RealtimeItemType Type { get; set; }

Property Value

RealtimeItemType

Usage

Usage statistics for the response.

public UsageMetadata Usage { get; set; }

Property Value

UsageMetadata

Methods

AssistantMessage(string)

public static RealtimeItem AssistantMessage(string text)

Parameters

text string

Returns

RealtimeItem

AssistantVoice(string, string)

public static RealtimeItem AssistantVoice(string base64EncodedAudio, string transcript)

Parameters

base64EncodedAudio string
transcript string

Returns

RealtimeItem

FromMessage(Message)

public static RealtimeItem FromMessage(Message message)

Parameters

message Message

Returns

RealtimeItem

GetResponseText()

public string GetResponseText()

Returns

string

GetResponseTranscript()

public string GetResponseTranscript()

Returns

string

McpApproval(McpApprovalResponse)

public static RealtimeItem McpApproval(McpApprovalResponse approval)

Parameters

approval McpApprovalResponse

Returns

RealtimeItem

ToMessage()

public Message ToMessage()

Returns

Message

ToStatusString()

public string ToStatusString()

Returns

string

TruncateAudioAt(long)

public void TruncateAudioAt(long audioEndMs)

Parameters

audioEndMs long

UserMessage(string)

public static RealtimeItem UserMessage(string text)

Parameters

text string

Returns

RealtimeItem

UserVoice(string)

public static RealtimeItem UserVoice(string base64EncodedAudio)

Parameters

base64EncodedAudio string

Returns

RealtimeItem