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

新增Console AgentBuilder对话能力 #203

merged 9 commits into from
Mar 20, 2024

Conversation

ide-rea
Copy link
Contributor

@ide-rea ide-rea commented Mar 20, 2024

No description provided.

appbuilder/core/console/agent_builder/agent_builder.py Outdated Show resolved Hide resolved
response (obj: `AgentBuilder`): 智能体实例
"""
super().__init__(**kwargs)
if len(app_id) == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议此处加上 isinstance(app_id, str)的校验,不然用户传入 int 类型的app_id,报错为int has not len(),用户体验不好

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,已解决


## 简介

AgentBuilder组件支持调用Console端已发布智能体应用的会话能力
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console端:进一步说明是哪个地址的哪个功能创建的功能

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,已补充

appbuilder/core/console/agent_builder/README.md Outdated Show resolved Hide resolved
appbuilder/core/console/agent_builder/__init__.py Outdated Show resolved Hide resolved
from typing import Union


class HTTPRequest(BaseModel):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件名不要叫model,容易引起歧义

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改成data_class

"os.environ[\"APPBUILDER_TOKEN\"] =\"...\"\n",
"\n",
"# 使用获取到的应用ID,初始化Agent实例\n",
"agent_builder = appbuilder.AgentBuilder(\"35f4fed3-d530-4dad-bc8e-f2150a4450be\")\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个appid,是所有的token都能访问么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,当前逻辑是用户账户下的密钥,可以调用所有已发布的应用

"import os\n",
"\n",
"# 配置密钥\n",
"os.environ[\"APPBUILDER_TOKEN\"] =\"...\"\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里最好加个注释:配置密钥 + 注意以下示例仅针对官方已经创建的appid有效,可以提供个话术

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,已补充

Copy link
Collaborator

@MrChengmo MrChengmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@guru4elephant guru4elephant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guru4elephant guru4elephant merged commit 25d1a1e into baidubce:master Mar 20, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants