Class ThreadCreateParams.Message.Role
-
- All Implemented Interfaces:
-
com.openai.core.Enum
public final class ThreadCreateParams.Message.Role implements Enum
The role of the entity that is creating the message. Allowed values include:
user
: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.assistant
: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
ThreadCreateParams.Message.Role.Known
An enum containing Role's known values.
public enum
ThreadCreateParams.Message.Role.Value
An enum containing Role's known values, as well as an _UNKNOWN member.
An instance of Role can contain an unknown value in a couple of cases:
It was deserialized from data that doesn't match any known member. For example, if the SDK is on an older version than the API, then the API may respond with new members that the SDK is unaware of.
It was constructed with an arbitrary value using the of method.
-
Field Summary
Fields Modifier and Type Field Description public final static ThreadCreateParams.Message.Role
USER
public final static ThreadCreateParams.Message.Role
ASSISTANT
-
Method Summary
Modifier and Type Method Description final JsonField<String>
_value()
Returns this class instance's raw value. final ThreadCreateParams.Message.Role.Value
value()
Returns an enum member corresponding to this class instance's value, or Value._UNKNOWN if the class was instantiated with an unknown value. final ThreadCreateParams.Message.Role.Known
known()
Returns an enum member corresponding to this class instance's value. final String
asString()
Returns this class instance's primitive wire representation. final ThreadCreateParams.Message.Role
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ThreadCreateParams.Message.Role
of(String value)
-
-
Method Detail
-
_value
final JsonField<String> _value()
Returns this class instance's raw value.
This is usually only useful if this instance was deserialized from data that doesn't match any known member, and you want to know that value. For example, if the SDK is on an older version than the API, then the API may respond with new members that the SDK is unaware of.
-
value
final ThreadCreateParams.Message.Role.Value value()
Returns an enum member corresponding to this class instance's value, or Value._UNKNOWN if the class was instantiated with an unknown value.
Use the known method instead if you're certain the value is always known or if you want to throw for the unknown case.
-
known
final ThreadCreateParams.Message.Role.Known known()
Returns an enum member corresponding to this class instance's value.
Use the value method instead if you're uncertain the value is always known and don't want to throw for the unknown case.
-
asString
final String asString()
Returns this class instance's primitive wire representation.
This differs from the toString method because that method is primarily for debugging and generally doesn't throw.
-
validate
final ThreadCreateParams.Message.Role validate()
-
of
final static ThreadCreateParams.Message.Role of(String value)
-
-
-
-