Table of Contents

Class ConversationItem

Namespace
OpenAI.Realtime
Assembly
OpenAI-DotNet.dll
public sealed class ConversationItem
Inheritance
ConversationItem
Inherited Members

Constructors

ConversationItem()

public ConversationItem()

ConversationItem(RealtimeContent)

public ConversationItem(RealtimeContent content)

Parameters

content RealtimeContent

ConversationItem(Role, RealtimeContent)

public ConversationItem(Role role, RealtimeContent content)

Parameters

role Role
content RealtimeContent

ConversationItem(Role, IEnumerable<RealtimeContent>)

public ConversationItem(Role role, IEnumerable<RealtimeContent> content)

Parameters

role Role
content IEnumerable<RealtimeContent>

ConversationItem(Tool)

public ConversationItem(Tool tool)

Parameters

tool Tool

ConversationItem(ToolCall, string)

public ConversationItem(ToolCall toolCall, string output)

Parameters

toolCall ToolCall
output string

Properties

Content

The content of the item.

[JsonInclude]
[JsonPropertyName("content")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public IReadOnlyList<RealtimeContent> Content { get; }

Property Value

IReadOnlyList<RealtimeContent>

FunctionArguments

The arguments of the function call.

[JsonInclude]
[JsonPropertyName("arguments")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public JsonNode FunctionArguments { get; }

Property Value

JsonNode

FunctionCallId

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

[JsonInclude]
[JsonPropertyName("call_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string FunctionCallId { get; }

Property Value

string

FunctionName

The name of the function being called.

[JsonInclude]
[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string FunctionName { get; }

Property Value

string

FunctionOutput

The output of the function call (for "function_call_output" items).

[JsonInclude]
[JsonPropertyName("output")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string FunctionOutput { get; }

Property Value

string

Id

The unique ID of the item.

[JsonInclude]
[JsonPropertyName("id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string Id { get; }

Property Value

string

Object

The object type, must be "realtime.item".

[JsonInclude]
[JsonPropertyName("object")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string Object { get; }

Property Value

string

Role

The role associated with the item ("user", "assistant", "system").

[JsonInclude]
[JsonPropertyName("role")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonConverter(typeof(JsonStringEnumConverter<Role>))]
public Role Role { get; }

Property Value

Role

Status

The status of the item ("completed", "in_progress", "incomplete").

[JsonInclude]
[JsonPropertyName("status")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonConverter(typeof(JsonStringEnumConverter<RealtimeResponseStatus>))]
public RealtimeResponseStatus Status { get; }

Property Value

RealtimeResponseStatus

Type

The type of the item ("message", "function_call", "function_call_output").

[JsonInclude]
[JsonPropertyName("type")]
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
[JsonConverter(typeof(JsonStringEnumConverter<ConversationItemType>))]
public ConversationItemType Type { get; }

Property Value

ConversationItemType

Operators

implicit operator ConversationItem(string)

public static implicit operator ConversationItem(string text)

Parameters

text string

Returns

ConversationItem