-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Description
问题描述:
大佬好,我在尝试将 VCPToolBox 后端配置为 Google Gemini 的 OpenAI 兼容接口时,后端一直报错 Invalid URL,导致无法对话。
环境信息:
- 客户端: VCPChat (Windows 最新版)
- 服务端: VCPToolBox (Ubuntu 22/Node.js v20.20.0)
- 模型:
gemini-1.5-flash
复现步骤:
- 在服务端
config.env中配置了 Google 的兼容接口地址:
API_URL=https://generativelanguage.googleapis.com/v1beta/openai/
API_KEY=AIzaSy...(我的谷歌Key)
(尝试过末尾加斜杠 / 和不加斜杠,结果一样)
2. 重启服务端 (pm2 restart vcp-main)。
3. 客户端发送消息(如“你好”)。
4. 客户端控制台立刻收到 500 错误,详情显示 Invalid URL。
报错日志 (截图/文本):
VCP请求错误 (catch block): Error: VCP请求失败: 404 - 未知服务端错误
at C:\VCP\VCPChat\modules\ipc\chatHandlers.js:856:29
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Session.<anonymous> (node:electron/js2c/browser_init:2:107253) {
details: { choices: [ [Object] ] },
status: 404
}
[FileWatcher] Internal save signaled at: 1770602839055
[FileWatcher] Ignored internal save event 'change' for: C:\VCP\VCPChat\AppData\UserData\_Agent_1770365928860_1770365928860\topics\topic_1770543833095\history.json (time since last save: 336ms)
[FileWatcher] Internal save window naturally expired
猜测原因:
看起来像是 Node.js 后端在拼接 API_URL 和 /chat/completions 时,对 generativelanguage 这个长地址解析失败,或者是因为配置文件里混入了 Windows 的换行符 (\r) 导致 URL 读取时带有非法字符?
教程/文档建议 (重要 QAQ)
狮子大大,能不能出一个新的使用教程?QAQ
我把现有的教程都扒了一遍(包括那个小白搭建视频),发现版本更新太快了,现在的 UI 和视频里已经不一样了。 特别是 【模型设置 (Model Settings)】 这一块,新版界面改动很大,旧教程里找不到对应的设置入口,对于想用 Gemini 或自定义 OpenAI 接口的用户来说,摸索成本太高了。
希望能更新一下这部分的文档或出个新视频,救救孩子!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels