MsgRole
public enum MsgRole
io/agentscope/core/message/MsgRole.java:35–67定义消息角色相关取值的枚举。位于 io.agentscope.core.message 包。核心成员包括 USER、ASSISTANT、SYSTEM、TOOL。
Defines the role of a message participant in agent conversations.
This enum specifies the origin or purpose of each message in the conversation flow, enabling proper message routing, processing, and context management.
Message roles:
-
#USER- Messages from human users or external inputs -
#ASSISTANT- Messages generated by AI agents or assistants -
#SYSTEM- System instructions, prompts, or configuration messages -
#TOOL- Messages containing tool execution results or responses
The role is essential for determining how messages should be processed and formatted when interacting with different LLM APIs and tool systems.
枚举常量摘要Enum Constant Summary
| 常量Constant | 说明Description |
|---|---|
USER | 执行用户相关操作。 User role for messages from human users or external inputs. |
ASSISTANT | 执行 `ASSISTANT` 方法。 Assistant role for messages generated by AI agents or assistants. |
SYSTEM | 用于系统指令,提示词,或配置消息的系统角色。 System role for system instructions, prompts, or configuration messages. |
TOOL | 执行工具相关操作。 Tool role for messages containing tool execution results or responses. |
枚举常量详情Enum Constant Detail
USER
USER
执行用户相关操作。
User role for messages from human users or external inputs.
io/agentscope/core/message/MsgRole.java:42ASSISTANT
ASSISTANT
执行 ASSISTANT 方法。
Assistant role for messages generated by AI agents or assistants.
io/agentscope/core/message/MsgRole.java:50SYSTEM
SYSTEM
用于系统指令,提示词,或配置消息的系统角色。
System role for system instructions, prompts, or configuration messages.
io/agentscope/core/message/MsgRole.java:58TOOL
TOOL
执行工具相关操作。
Tool role for messages containing tool execution results or responses.
io/agentscope/core/message/MsgRole.java:66