public class AgentSessionHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FINAL_ACTION |
| Constructor and Description |
|---|
AgentSessionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addUserMessage(AgentSession agentSession,
String userMessage)
添加用户消息
|
static AgentSession |
initAgentSession(List<ConversationMessage> messages)
使用一组消息初始化一个AgentSession
|
static AgentSession |
initAgentSession(String userMessage)
使用用户消息初始化一个AgentSession
|
static String |
printPlan(AgentSession agentSession)
打印AgentSession
|
static void |
setFirstToolOutput(AgentSession agentSession,
String observation)
向Agent的当前步骤设置工具返回结果
|
static void |
setUserFeedback(AgentSession agentSession,
String userFeedback)
向Agent的当前步骤设置用户反馈
|
static void |
updateAssistantMessage(AgentSession agentSession,
boolean override)
使用当前的action更新AssistantMessage的内容
|
public static final String FINAL_ACTION
public static AgentSession initAgentSession(String userMessage)
userMessage - 用户消息public static AgentSession initAgentSession(List<ConversationMessage> messages)
messages - 一组消息public static void updateAssistantMessage(AgentSession agentSession, boolean override)
agentSession - AgentSessionoverride - 是否覆盖已有的内容public static void addUserMessage(AgentSession agentSession, String userMessage)
agentSession - AgentSessionuserMessage - 用户消息public static void setFirstToolOutput(AgentSession agentSession, String observation)
agentSession - AgentSessionobservation - 工具返回结果public static void setUserFeedback(AgentSession agentSession, String userFeedback)
agentSession - AgentSessionuserFeedback - 用户反馈public static String printPlan(AgentSession agentSession)
agentSession - AgentSessionCopyright © 2024. All rights reserved.