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
-
objectRealtimeItem
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
Error
The error from the MCP tool call, if any.
public McpException Error { get; set; }
Property Value
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
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
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
StatusDetails
Additional details about the status.
public RealtimeItemStatusDetails StatusDetails { get; set; }
Property Value
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
Usage
Usage statistics for the response.
public UsageMetadata Usage { get; set; }
Property Value
Methods
AssistantMessage(string)
public static RealtimeItem AssistantMessage(string text)
Parameters
textstring
Returns
AssistantVoice(string, string)
public static RealtimeItem AssistantVoice(string base64EncodedAudio, string transcript)
Parameters
base64EncodedAudiostringtranscriptstring
Returns
FromMessage(Message)
public static RealtimeItem FromMessage(Message message)
Parameters
messageMessage
Returns
GetResponseText()
public string GetResponseText()
Returns
- string
GetResponseTranscript()
public string GetResponseTranscript()
Returns
- string
McpApproval(McpApprovalResponse)
public static RealtimeItem McpApproval(McpApprovalResponse approval)
Parameters
approvalMcpApprovalResponse
Returns
ToMessage()
public Message ToMessage()
Returns
ToStatusString()
public string ToStatusString()
Returns
- string
TruncateAudioAt(long)
public void TruncateAudioAt(long audioEndMs)
Parameters
audioEndMslong
UserMessage(string)
public static RealtimeItem UserMessage(string text)
Parameters
textstring
Returns
UserVoice(string)
public static RealtimeItem UserVoice(string base64EncodedAudio)
Parameters
base64EncodedAudiostring