Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增Console AgentBuilder对话能力 #203

Merged
merged 9 commits into from
Mar 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
补充Notebook样例运行条件
  • Loading branch information
ide-rea committed Mar 20, 2024
commit 6a55ee35c3f8447c4f6640eee02e2a9b51b7520b
46 changes: 21 additions & 25 deletions cookbooks/agent_builder.ipynb
Original file line number Diff line number Diff line change
@@ -43,12 +43,17 @@
"source": [
"import appbuilder\n",
"import os\n",
"# 注意以下示例正确运行依赖的条件包括:\n",
"# 1. 在百度智能云千帆AppBuilder官网使用AgentBuilder创建应用且应用已发布\n",
"# 2. 密钥正确有效\n",
"# 3. 密钥需要与发布应用正确对应,即需要使用发布应用时的账户下的密钥\n",
"\n",
"# 配置密钥\n",
"os.environ[\"APPBUILDER_TOKEN\"] =\"...\"\n",
"# 配置密钥与应用ID\n",
"os.environ[\"APPBUILDER_TOKEN\"] =\"secret_key\"\n",
"app_id = \"35f4fed3-d530-4dad-bc8e-f2150a4450be\"\n",
"\n",
"# 使用获取到的应用ID,初始化Agent实例\n",
"agent_builder = appbuilder.AgentBuilder(\"35f4fed3-d530-4dad-bc8e-f2150a4450be\")\n",
"# 初始化Agent\n",
"agent_builder = appbuilder.AgentBuilder(app_id)\n",
"\n",
"# 创建会话ID\n",
"conversation_id = agent_builder.create_conversation()\n",
@@ -65,7 +70,8 @@
" print(\"快递查询助理生成的音频播放地址:\", ev.detail[\"audio\"])"
],
"metadata": {
"collapsed": false
"collapsed": false,
"is_executing": true
},
"id": "5b3a8a246cf0b467"
},
@@ -97,11 +103,17 @@
"import os\n",
"import appbuilder\n",
"\n",
"# 配置密钥\n",
"# 注意以下示例正确运行依赖的条件包括:\n",
"# 1. 在百度智能云千帆AppBuilder官网使用AgentBuilder创建应用且应用已发布\n",
"# 2. 密钥正确有效\n",
"# 3. 密钥需要与发布的应用正确对应,即需要使用发布应用时的账户下的密钥\n",
"\n",
"# 配置密钥与应用ID\n",
"os.environ[\"APPBUILDER_TOKEN\"] =\"...\"\n",
"app_id = \"7016e0d3-451b-4a47-a818-dc0a16d4b496\" \n",
"\n",
"# 使用获取到的应用ID,初始化Agent实例\n",
"agent_builder = appbuilder.AgentBuilder(\"7016e0d3-451b-4a47-a818-dc0a16d4b496\")\n",
"# 初始化Agent实例\n",
"agent_builder = appbuilder.AgentBuilder(\"app_id\")\n",
"\n",
"# 创建会话ID\n",
"conversation_id = agent_builder.create_conversation()\n",
@@ -115,25 +127,9 @@
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-03-20T06:23:38.529562Z",
"start_time": "2024-03-20T06:23:38.524388Z"
}
"is_executing": true
},
"id": "4b825feeecbd7a2f"
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2024-03-20T06:23:38.526199Z"
}
},
"id": "935f6b41870f190"
}
],
"metadata": {