| Package | Description |
|---|---|
| com.huaweicloud.pangu.dev.sdk.agent | |
| com.huaweicloud.pangu.dev.sdk.api.agent | |
| com.huaweicloud.pangu.dev.sdk.skill |
| Modifier and Type | Method and Description |
|---|---|
AgentSession |
AbstractAgent.run(AgentSession agentSession) |
AgentSession |
AbstractAgent.run(List<ConversationMessage> messages) |
AgentSession |
AbstractAgent.run(String query) |
AgentSession |
AbstractAgent.runStep(AgentSession agentSession) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
AbstractAgent.getSystemPrompt(AgentSession agentSession) |
protected boolean |
AbstractAgent.needInterrupt(AgentSession agentSession) |
protected void |
AbstractAgent.noticeSessionEnd(AgentSession agentSession,
AgentAction action) |
protected void |
AbstractAgent.noticeSessionIteration(AgentSession agentSession,
AgentAction action) |
protected void |
ReactAgent.react(AgentSession agentSession) |
protected abstract void |
AbstractAgent.react(AgentSession agentSession)
迭代解决问题
|
protected void |
ReactPanguAgent.react(AgentSession agentSession) |
AgentSession |
AbstractAgent.run(AgentSession agentSession) |
AgentSession |
AbstractAgent.runStep(AgentSession agentSession) |
protected void |
AbstractAgent.toolExecute(Tool tool,
String inputJson,
AgentSession agentSession) |
| Modifier and Type | Method and Description |
|---|---|
static AgentSession |
AgentSessionHelper.initAgentSession(List<ConversationMessage> messages)
使用一组消息初始化一个AgentSession
|
static AgentSession |
AgentSessionHelper.initAgentSession(String userMessage)
使用用户消息初始化一个AgentSession
|
AgentSession |
Agent.run(AgentSession agentSession)
递归执行Agent,直到完成所有步骤的执行
|
AgentSession |
Agent.run(List<ConversationMessage> messages)
递归执行Agent,直到完成所有步骤的执行
|
AgentSession |
Agent.run(String query)
递归执行Agent,直到完成所有步骤的执行
|
AgentSession |
Agent.runStep(AgentSession agentSession)
单步执行Agent,提供干预能力
|
| Modifier and Type | Method and Description |
|---|---|
static void |
AgentSessionHelper.addUserMessage(AgentSession agentSession,
String userMessage)
添加用户消息
|
default boolean |
AgentListener.onCheckInterruptRequirement(AgentSession agentSession)
onSessionIteration调用结束后,检查Agent是否需要终止,如果需要终止,则返回true,默认不终止
可以在终止前对agentSession进行修改,如:修改agent的finalAnswer
|
default void |
AgentListener.onSessionEnd(AgentSession agentSession)
Session结束时调用
|
default void |
AgentListener.onSessionIteration(AgentSession agentSession)
Session迭代过程中调用
|
default void |
AgentListener.onSessionStart(AgentSession agentSession)
Session启动时调用
|
static String |
AgentSessionHelper.printPlan(AgentSession agentSession)
打印AgentSession
|
AgentSession |
Agent.run(AgentSession agentSession)
递归执行Agent,直到完成所有步骤的执行
|
AgentSession |
Agent.runStep(AgentSession agentSession)
单步执行Agent,提供干预能力
|
static void |
AgentSessionHelper.setFirstToolOutput(AgentSession agentSession,
String observation)
向Agent的当前步骤设置工具返回结果
|
static void |
AgentSessionHelper.setUserFeedback(AgentSession agentSession,
String userFeedback)
向Agent的当前步骤设置用户反馈
|
static void |
AgentSessionHelper.updateAssistantMessage(AgentSession agentSession,
boolean override)
使用当前的action更新AssistantMessage的内容
|
| Modifier and Type | Method and Description |
|---|---|
String |
AgentSessionSkill.summary(AgentSession session) |
Copyright © 2024. All rights reserved.