ChatRole Class

public final class ChatRole
extends ExpandableStringEnum<ChatRole>

A description of the intended purpose of a message within a chat completions interaction.

Field Summary

Modifier and Type Field and Description
static final ChatRole ASSISTANT

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

static final ChatRole FUNCTION

The role that provides function results for chat completions.

static final ChatRole SYSTEM

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

static final ChatRole TOOL

The role that represents extension tool activity within a chat completions operation.

static final ChatRole USER

The role that provides input for chat completions.

Constructor Summary

Constructor Description
ChatRole()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of ChatRole value.

Method Summary

Modifier and Type Method and Description
static ChatRole fromString(String name)

Creates or finds a ChatRole from its string representation.

static Collection<ChatRole> values()

Gets known ChatRole values.

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

ASSISTANT

public static final ChatRole ASSISTANT

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

FUNCTION

public static final ChatRole FUNCTION

The role that provides function results for chat completions.

SYSTEM

public static final ChatRole SYSTEM

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

TOOL

public static final ChatRole TOOL

The role that represents extension tool activity within a chat completions operation.

USER

public static final ChatRole USER

The role that provides input for chat completions.

Constructor Details

ChatRole

@Deprecated
public ChatRole()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of ChatRole value.

Method Details

fromString

public static ChatRole fromString(String name)

Creates or finds a ChatRole from its string representation.

Parameters:

name - a name to look for.

Returns:

the corresponding ChatRole.

values

public static Collection values()

Gets known ChatRole values.

Returns:

known ChatRole values.

Applies to