MessageRole
Enum for chat message roles in LLM conversations.Overview
MessageRole is a str enum that defines the four possible sender roles for a PromptMessage. Because it extends str, enum members compare equal to their string values.
Values
| Value | Enum Member | Description |
|---|---|---|
"system" | MessageRole.SYSTEM | System instructions that guide the model’s behavior and set context. |
"user" | MessageRole.USER | User-provided messages and input. |
"assistant" | MessageRole.ASSISTANT | AI assistant responses, including tool-call requests. |
"tool" | MessageRole.TOOL | Tool/function execution results returned to the model. |