Class Message
public sealed class Message : BaseResponse, IResponseItem, IServerSentEvent, IListItem
- Inheritance
-
Message
- Implements
- Inherited Members
Constructors
Message()
public Message()
Message(Role, IResponseContent)
public Message(Role role, IResponseContent content)
Parameters
role
Rolecontent
IResponseContent
Message(Role, IEnumerable<IResponseContent>)
public Message(Role role, IEnumerable<IResponseContent> content)
Parameters
role
Rolecontent
IEnumerable<IResponseContent>
Message(Role, string)
public Message(Role role, string text)
Parameters
Properties
Content
[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("content")]
public IReadOnlyList<IResponseContent> Content { get; }
Property Value
Id
The unique ID of this response item.
[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("id")]
public string Id { get; }
Property Value
Object
[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("object")]
public string Object { get; }
Property Value
Role
[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("role")]
public Role Role { get; }
Property Value
Status
The status of the response item.
[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("status")]
public ResponseStatus Status { get; }
Property Value
Type
[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
[JsonPropertyName("type")]
public ResponseItemType Type { get; }
Property Value
Methods
FromSchema<T>(JsonSerializerOptions)
public T FromSchema<T>(JsonSerializerOptions options = null)
Parameters
options
JsonSerializerOptions
Returns
- T
Type Parameters
T
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
implicit operator Message(string)
public static implicit operator Message(string input)
Parameters
input
string