public enum Role
- Object
- Enum<Role>
- Role
ImplementsComparable<Role>
Author of a
ChatMessage. Maps directly to the role string sent on
the wire by every supported LLM provider.Enum constants
SYSTEM | Developer-supplied instructions that steer the assistant. |
USER | End-user content (text, images, tool results). |
ASSISTANT | Model output. |
TOOL | Result of a function/tool invocation, sent back to the model so it can continue reasoning. |
Methods
public static Role[] values() | |
public static Role valueOf(String name) |
Inherited methods
Enum constant details
SYSTEM
SYSTEMDeveloper-supplied instructions that steer the assistant. Sent
once at the head of the conversation. Gemini receives these as
systemInstruction rather than a normal message; the Gemini
client handles the conversion internally.USER
USEREnd-user content (text, images, tool results).
ASSISTANT
ASSISTANTModel output. When the assistant calls a tool the
ChatMessage also carries one or more ToolCall entries.TOOL
TOOLResult of a function/tool invocation, sent back to the model so
it can continue reasoning. Paired with the originating
ToolCall via ChatMessage.getToolCallId().Method details
values
public static Role[] values()valueOf
public static Role valueOf(String name)