Skip to content

Commit

Permalink
chainlit chainlit_agent支持工作流Agent应用
Browse files Browse the repository at this point in the history
  • Loading branch information
userpj committed Dec 13, 2024
1 parent b06664f commit 90f56ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
9 changes: 6 additions & 3 deletions cookbooks/components/agent_runtime.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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。可在页面上上传文档(可选)、执行对话。"
]
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions docs/BasisModule/Deployment/agentruntime.md
Original file line number Diff line number Diff line change
Expand Up @@ -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应用。

#### 方法参数

Expand All @@ -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))
agent_builder = appbuilder.AppBuilderClient(app_id)
agent = appbuilder.AgentRuntime(component=agent_builder)
agent.chainlit_agent(port=8091)
```

0 comments on commit 90f56ee

Please sign in to comment.