Partilhar via


ChatRole Struct

Definition

Describes the intended purpose of a message within a chat completion interaction.

public value class ChatRole : IEquatable<Microsoft::Extensions::AI::ChatRole>
[System.Text.Json.Serialization.JsonConverter(typeof(Microsoft.Extensions.AI.ChatRole+Converter))]
public readonly struct ChatRole : IEquatable<Microsoft.Extensions.AI.ChatRole>
[<System.Text.Json.Serialization.JsonConverter(typeof(Microsoft.Extensions.AI.ChatRole+Converter))>]
type ChatRole = struct
Public Structure ChatRole
Implements IEquatable(Of ChatRole)
Inheritance
ChatRole
Attributes
Implements

Constructors

ChatRole(String)

Initializes a new instance of the ChatRole struct with the provided value.

Properties

Assistant

Gets the role that provides responses to system-instructed, user-prompted input.

System

Gets the role that instructs or sets the behavior of the assistant.

Tool

Gets the role that provides additional information and references for chat completions.

User

Gets the role that provides input for chat completions.

Value

Gets the value associated with this ChatRole.

Methods

Equals(ChatRole)

Indicates whether the current object is equal to another object of the same type.

Equals(Object)

Indicates whether this instance and a specified object are equal.

GetHashCode()

Returns the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

Operators

Equality(ChatRole, ChatRole)

Returns a value indicating whether two ChatRole instances are equivalent, as determined by a case-insensitive comparison of their values.

Inequality(ChatRole, ChatRole)

Returns a value indicating whether two ChatRole instances are not equivalent, as determined by a case-insensitive comparison of their values.

Applies to