Skip to content

[Bug] 关闭网页搜索后百度 AI 搜索 Key 配置项仍显示 #7985

@RhoninSeiei

Description

@RhoninSeiei

What happened / 发生了什么

在 WebUI 的普通配置页面中,网页搜索功能关闭后,百度 AI 搜索的 Key 配置项仍然显示。

具体表现:

  1. 打开“网页搜索”功能。
  2. 将“网页搜索提供商”选择为 baidu_ai_search
  3. 页面会显示“百度千帆智能云 APP Builder API Key”,此时行为正常。
  4. 关闭“启用网页搜索”后,其他依赖网页搜索开启状态的配置项会隐藏,但“百度千帆智能云 APP Builder API Key”仍然保留在页面上。

预期行为:关闭“启用网页搜索”后,百度 AI 搜索的 Key 配置项也应隐藏,与 Tavily、BoCha、Brave、Firecrawl 等提供商的 Key 配置项行为保持一致。

从配置元数据看,provider_settings.websearch_baidu_app_builder_key 当前只判断了 provider_settings.websearch_provider == "baidu_ai_search",缺少 provider_settings.web_search == True 条件。

Reproduce / 如何复现?

  1. 进入 WebUI。
  2. 打开“设置” -> “普通配置”。
  3. 找到“网页搜索”配置块。
  4. 开启“启用网页搜索”。
  5. 将“网页搜索提供商”选择为 baidu_ai_search
  6. 确认页面显示“百度千帆智能云 APP Builder API Key”。
  7. 关闭“启用网页搜索”。
  8. 观察页面,“百度千帆智能云 APP Builder API Key”仍然显示。

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot:v4.24.2

部署方式:Docker

运行环境:Linux

该问题发生在 WebUI 配置页面,和模型提供商、消息平台适配器无关。

OS

Linux

Logs / 报错日志

这是 WebUI 配置项条件显示问题,后端无报错日志。

开启网页搜索并选择 baidu_ai_search 时,百度 Key 配置项正常显示:

websearch enabled baidu provider

关闭网页搜索后,百度 Key 配置项仍然显示:

websearch disabled baidu key still visible

同一配置区域的操作过程:

websearch config toggle reproduction

疑似问题位置:

"provider_settings.websearch_baidu_app_builder_key": {
    "description": "百度千帆智能云 APP Builder API Key",
    "type": "string",
    "hint": "参考:https://console.bce.baidu.com/iam/#/iam/apikey/list",
    "condition": {
        "provider_settings.websearch_provider": "baidu_ai_search",
    },
},

建议与其他搜索提供商 Key 配置项保持一致,补充 provider_settings.web_search: True 条件。

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:webuiThe bug / feature is about webui(dashboard) of astrbot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions