枚举类 MsgRole
- 所有已实现的接口:
Serializable,Comparable<MsgRole>,Constable
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 inputsASSISTANT- Messages generated by AI agents or assistantsSYSTEM- System instructions, prompts, or configuration messagesTOOL- 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.
-
嵌套类概要
从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
枚举常量概要
枚举常量枚举常量说明Assistant role for messages generated by AI agents or assistants.System role for system instructions, prompts, or configuration messages.Tool role for messages containing tool execution results or responses.User role for messages from human users or external inputs. -
方法概要
-
枚举常量详细资料
-
USER
User role for messages from human users or external inputs.These messages typically contain user questions, commands, or input data that the agent needs to process or respond to.
-
ASSISTANT
Assistant role for messages generated by AI agents or assistants.These messages contain the agent's responses, reasoning, or actions in response to user messages or system prompts.
-
SYSTEM
System role for system instructions, prompts, or configuration messages.These messages typically contain setup instructions, context information, or system-level directives that guide agent behavior.
-
TOOL
Tool role for messages containing tool execution results or responses.These messages contain the output from tool executions, including return values, error messages, or status information from external tools.
-
-
方法详细资料
-
values
返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同- 返回:
- 包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
-
valueOf
返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- 如果该枚举类没有带有指定名称的常量NullPointerException- 如果参数为空值
-