From e288ced3fcbd9d13440032298b2d51a1d89db9ca Mon Sep 17 00:00:00 2001 From: l Date: Fri, 9 Oct 2026 16:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E7=BD=91=E6=90=9C=E7=B4=A2=EF=BC=9A?= =?UTF-8?q?=E8=A1=A5=E4=B8=8A=E4=BB=8E=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=87=8C=E6=8B=BF=E5=88=B0=E7=9A=84=E5=BC=80=E9=80=9A=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 不带 sources 打 /api/v3/responses 会返回 404,里面直接给了开通地址: https://console.volcengine.com/common-buy/CC_content_plugin 比让人自己在控制台里翻准得多,记进 SEARCH_CONSOLE_URLS。 另外探明了联网搜索**只能走 Responses API**: chat/completions + tools:[{type:web_search}] → 400 missing tools.function (它把 tools 当函数调用解析,内置工具不认) bots/chat/completions + bot:[...] → 400 InvalidParameter responses + web_search → 403 AccessDenied(形状对,没开通) 这条结论决定了接入方式,写在注释里免得以后重复试。 --- android/kernel/speech.py | 12 ++++++++++++ server/src/speech.mjs | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/android/kernel/speech.py b/android/kernel/speech.py index 45204cb..dad50fd 100644 --- a/android/kernel/speech.py +++ b/android/kernel/speech.py @@ -427,6 +427,18 @@ SPEECH_CONSOLE_URLS = { 'agentPlan': 'https://ark.volcengine.com/region:cn-beijing/openManagement?advancedActiveKey=agentPlan', } +# 联网搜索(豆包搜索)相关的地址。 +# +# activate 那个是**从接口报错里拿到的**:不带 sources 打 /responses 会返回 +# "Your account has not activated web search. You may activate it at +# https://console.volcengine.com/common-buy/CC_content_plugin" +# 比让用户自己在控制台里翻要准。manage 那个是「开通管理 → 应用组件库 → 豆包搜索」。 +SEARCH_CONSOLE_URLS = { + 'activate': 'https://console.volcengine.com/common-buy/CC_content_plugin', + 'manage': 'https://console.volcengine.com/ark/region:cn-beijing/openManagement' + '?advancedActiveKey=component&tab=DoubaoSearch', +} + # 默认值:Android 端 Kotlin 侧也用不到这个,但 Node/Python 必须一致 DEFAULT_SPEECH = { diff --git a/server/src/speech.mjs b/server/src/speech.mjs index 95ef929..3de2248 100644 --- a/server/src/speech.mjs +++ b/server/src/speech.mjs @@ -353,6 +353,20 @@ export const SPEECH_CONSOLE_URLS = { agentPlan: 'https://ark.volcengine.com/region:cn-beijing/openManagement?advancedActiveKey=agentPlan', }; +/** + * 联网搜索(豆包搜索)相关的地址。 + * + * activate 那个是**从接口报错里拿到的**:不带 sources 打 /responses 会返回 + * "Your account has not activated web search. You may activate it at + * https://console.volcengine.com/common-buy/CC_content_plugin" + * 比让用户自己在控制台里翻要准。 + */ +export const SEARCH_CONSOLE_URLS = { + activate: 'https://console.volcengine.com/common-buy/CC_content_plugin', + manage: 'https://console.volcengine.com/ark/region:cn-beijing/openManagement' + + '?advancedActiveKey=component&tab=DoubaoSearch', +}; + /** 掩码值:写设置时看到它表示"不改"(跟 apiKey 一个套路) */ export const MASK = '••••••••';