diff --git a/cookbooks/components/agent_runtime.ipynb b/cookbooks/components/agent_runtime.ipynb index 63ee56d78..b222c6e2e 100644 --- a/cookbooks/components/agent_runtime.ipynb +++ b/cookbooks/components/agent_runtime.ipynb @@ -353,7 +353,7 @@ "source": [ "**1.3 对话框交互AppBuilderClient**\n", "\n", - "基于 chainlit 的对话框交互AppBuilderClient,可实现对话交互。\n", + "基于 chainlit 的对话框交互AppBuilderClient,可实现对话交互。支持工作流Agent、自主规划Agent应用。\n", "\n", "执行下面的代码,会启动一个 chainlit 页面,页面地址:0.0.0.0:8091。可在页面上上传文档(可选)、执行对话。" ] @@ -372,8 +372,8 @@ "os.environ[\"APPBUILDER_TOKEN\"] = \"...\"\n", "# 使用之前,在官网个人空间获取应用ID,如下图\n", "app_id= \"...\"\n", - "agent_builder = appbuilder.AppBuilderClient(app_id)\n", - "agent = appbuilder.AgentRuntime(component=agent_builder)\n", + "client = appbuilder.AppBuilderClient(app_id)\n", + "agent = appbuilder.AgentRuntime(client)\n", "agent.chainlit_agent(port=8091)" ] }, @@ -385,8 +385,11 @@ "在官网个人空间获取应用ID\n", "![get app_id](../app_builder_resources/app_id.png)\n", "\n", - "使用服务上传文件并对话示意图如下所示\n", - "![chainlit demo](./image/agent_runtime_with_chainlit_agent.png)" + "使用服务上传文件并对话示例图如下所示\n", + "![chainlit demo](./image/agent_runtime_with_chainlit_agent.png)\n", + "\n", + "使用工作流Agent应用对话示例如下图所示\n", + "![chainlit demo](./image/agent_runtime_with_chainlit_chatflow.png)" ] }, { diff --git a/cookbooks/components/image/agent_runtime_with_chainlit_chatflow.png b/cookbooks/components/image/agent_runtime_with_chainlit_chatflow.png new file mode 100644 index 000000000..1c0ba38db Binary files /dev/null and b/cookbooks/components/image/agent_runtime_with_chainlit_chatflow.png differ diff --git a/docs/BasisModule/Deployment/agentruntime.md b/docs/BasisModule/Deployment/agentruntime.md index fc18c4de8..84759e5f3 100644 --- a/docs/BasisModule/Deployment/agentruntime.md +++ b/docs/BasisModule/Deployment/agentruntime.md @@ -151,7 +151,7 @@ agent.chainlit_demo(port=8091) ``` ### 5、将 appbuilder client 服务化,提供 chainlit demo 页面`AgentRuntime.chainlit_agent(host='0.0.0.0', port=8091)` - +目前支持工作流Agent、自主规划Agent应用。 #### 方法参数 @@ -172,9 +172,7 @@ import os os.environ["APPBUILDER_TOKEN"] = '...' app_id = '...' # 已发布AppBuilder应用ID,可在console端查看 -builder = appbuilder.AppBuilderClient(app_id) -conversation_id = builder.create_conversation() -agent = appbuilder.AgentRuntime(component=builder) -message = appbuilder.Message({"query": "北京今天天气怎么样"}) -print(agent.chat(message, stream=False)) +client = appbuilder.AppBuilderClient(app_id) +agent = appbuilder.AgentRuntime(component=client) +agent.chainlit_agent(port=8091) ``` \ No newline at end of file