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.
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
|
Edit this page
View Source
Approve
Whether the request was approved.
Declaration
[JsonProperty("approve")]
public bool? Approve { get; set; }
Property Value
|
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
|
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
|
Edit this page
View Source
Content
Declaration
[JsonProperty("content")]
public RealtimeItemContent[] Content { get; set; }
Property Value
|
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
|
Edit this page
View Source
Id
The unique ID of the item.
Declaration
[JsonProperty("id")]
public string Id { get; set; }
Property Value
|
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
|
Edit this page
View Source
Object
Declaration
[JsonProperty("object")]
public string Object { get; set; }
Property Value
|
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
|
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
|
Edit this page
View Source
Role
The role associated with the item.
Declaration
[JsonProperty("role")]
public ChatRole? Role { get; set; }
Property Value
|
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
|
Edit this page
View Source
Status
Declaration
[JsonProperty("status")]
public RealtimeItemStatus? Status { get; set; }
Property Value
|
Edit this page
View Source
StatusDetails
Additional details about the status.
Declaration
[JsonProperty("status_details")]
public RealtimeItemStatusDetails StatusDetails { get; set; }
Property Value
|
Edit this page
View Source
The MCP tools available on the server retrieved by McpToolList call.
Declaration
[JsonProperty("tools")]
public List<McpToolInfo> Tools { get; set; }
Property Value
|
Edit this page
View Source
Type
Declaration
[JsonProperty("type")]
public RealtimeItemType Type { get; set; }
Property Value
|
Edit this page
View Source
Usage
Usage statistics for the response.
Declaration
[JsonProperty("usage")]
public Usage Usage { get; set; }
Property Value
Methods
|
Edit this page
View Source
AssistantMessage(string)
Declaration
public static RealtimeItem AssistantMessage(string text)
Parameters
| Type |
Name |
Description |
| string |
text |
|
Returns
|
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
|
Edit this page
View Source
FromMessage(Message)
Declaration
public static RealtimeItem FromMessage(Message message)
Parameters
| Type |
Name |
Description |
| Message |
message |
|
Returns
|
Edit this page
View Source
GetResponseText()
Declaration
public string GetResponseText()
Returns
|
Edit this page
View Source
GetResponseTranscript()
Declaration
public string GetResponseTranscript()
Returns
|
Edit this page
View Source
McpApproval(McpApprovalResponse)
Declaration
public static RealtimeItem McpApproval(McpApprovalResponse approval)
Parameters
Returns
|
Edit this page
View Source
ToMessage()
Declaration
public Message ToMessage()
Returns
|
Edit this page
View Source
ToStatusString()
Declaration
public string ToStatusString()
Returns
|
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
|
Edit this page
View Source
UserVoice(string)
Declaration
public static RealtimeItem UserVoice(string base64EncodedAudio)
Parameters
| Type |
Name |
Description |
| string |
base64EncodedAudio |
|
Returns
Extension Methods