Class Message
-
- All Implemented Interfaces:
public final class Message
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Message.Builder
A builder for Message.
public final class
Message.Content
public final class
Message.Role
The role of the message. One of
unknown
,user
,assistant
,system
,critic
,discriminator
,developer
, ortool
.public final class
Message.Status
The status of item. One of
in_progress
,completed
, orincomplete
. Populated when items are returned via API.
-
Method Summary
Modifier and Type Method Description final String
id()
The unique ID of the message. final List<Message.Content>
content()
The content of the message final Message.Role
role()
The role of the message. final Message.Status
status()
The status of item. final JsonValue
_type()
The type of the message. final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<List<Message.Content>>
_content()
Returns the raw JSON value of content. final JsonField<Message.Role>
_role()
Returns the raw JSON value of role. final JsonField<Message.Status>
_status()
Returns the raw JSON value of status. final Map<String, JsonValue>
_additionalProperties()
final Message.Builder
toBuilder()
final Message
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Message.Builder
builder()
Returns a mutable builder for constructing an instance of Message. -
-
Method Detail
-
content
final List<Message.Content> content()
The content of the message
-
role
final Message.Role role()
The role of the message. One of
unknown
,user
,assistant
,system
,critic
,discriminator
,developer
, ortool
.
-
status
final Message.Status status()
The status of item. One of
in_progress
,completed
, orincomplete
. Populated when items are returned via API.
-
_type
final JsonValue _type()
The type of the message. Always set to
message
.Expected to always return the following:
JsonValue.from("message")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_content
final JsonField<List<Message.Content>> _content()
Returns the raw JSON value of content.
Unlike content, this method doesn't throw if the JSON field has an unexpected type.
-
_role
final JsonField<Message.Role> _role()
Returns the raw JSON value of role.
Unlike role, this method doesn't throw if the JSON field has an unexpected type.
-
_status
final JsonField<Message.Status> _status()
Returns the raw JSON value of status.
Unlike status, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Message.Builder toBuilder()
-
builder
final static Message.Builder builder()
Returns a mutable builder for constructing an instance of Message.
The following fields are required:
.id() .content() .role() .status()
-
-
-
-