Closed jiongjiongJOJO closed 3 days ago
👀 @jiongjiongJOJO
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
补充docker启动指令:
docker run -d -p 3210:3210 \
-e GOOGLE_API_KEY=xxxxxxxxxxxxxx \
-e GOOGLE_PROXY_URL=xxxxxxxxxxxxxxx \
-e GOOGLE_MODEL_LIST=xxxxxxxxxxxxxx \
-e ENABLED_XAI=1 \
-e XAI_API_KEY=xxxxxxxxxxxxx \
--name lobe-chat \
lobehub/lobe-chat
@jiongjiongJOJO 你好!我是Dosu,一个可以帮你解决bug、回答问题,甚至成为贡献者的机器人。我在这里可以帮你解决问题,等待人类维护者的到来。
The issue you're experiencing seems to be related to the '使用客户端请求模式' (client request mode) feature. When this feature is disabled, requests to xAI result in a 403 error, indicating that the service is not available in your region. This error is handled in the code by returning an error object with the error type AgentRuntimeErrorType.LocationNotSupportError
[1][2].
To resolve this, you might need to ensure that the client request mode is enabled, as it appears to allow requests to be made directly from the browser, potentially bypassing regional restrictions. Unfortunately, there doesn't seem to be documentation or environment settings in the Docker setup that explicitly control this feature, so it might require further investigation into the codebase or configuration files to find a way to enable it by default.
If you haven't found a way to toggle this feature through environment variables, it might be necessary to look into the code to see if there's a way to set this option programmatically or through a configuration file.
To continue talking to Dosu, mention @dosu.
This service is not available in your region.
当前网络环境问题,配置下代理
补个完整 Error Code
{
"error": {
"headers": {
"cf-ray": "8e9074557ae52f08-LAX",
"connection": "keep-alive",
"content-encoding": "br",
"content-type": "text/html",
"date": "Wed, 27 Nov 2024 07:37:42 GMT",
"server": "cloudflare",
"strict-transport-security": "max-age=31536000",
"transfer-encoding": "chunked",
"vary": "Accept-Encoding"
},
"stack": "Error: 403 <!doctype html>\n<html>\n<body>\n<p>This service is not available in your region.</p>\n</body>\n</html>\n at $.generate (/app/.next/server/edge-chunks/153.js:4:1768)\n at sW.makeStatusError (/app/.next/server/edge-chunks/153.js:4:15336)\n at sW.makeRequest (/app/.next/server/edge-chunks/153.js:4:16276)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Object.chat (/app/.next/server/edge-chunks/736.js:9:3864)\n at async /app/.next/server/app/(backend)/webapi/chat/[provider]/route.js:1:1486\n at async /app/.next/server/edge-chunks/107.js:1:90728\n at async $.execute (/app/.next/server/edge-chunks/107.js:1:88438)\n at async $.handle (/app/.next/server/edge-chunks/107.js:1:91995)\n at async ex.handler (/app/.next/server/edge-chunks/107.js:2:32453)",
"status": 403
},
"endpoint": "https://api.x.ai/v1",
"provider": "xai"
}
当前网络环境问题,配置下代理
抱歉,前段时间可以直连,我以为不用挂代理,没注意到这块🙄
✅ @jiongjiongJOJO
This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Current network environment problem, configure the proxy
Sorry, I was able to connect directly some time ago. I thought I didn’t need to connect to a proxy, so I didn’t notice this🙄
📦 部署环境
Docker
📌 软件版本
v1.34.1(docker:7bd808c546958a218eadfa065e621fd0f436c3be465108e7ed4ebdb9cf6f3ae7)
💻 系统环境
Ubuntu
🌐 浏览器
Chrome
🐛 问题描述
关闭"使用客户端请求模式"功能后,无法使用xAI
📷 复现步骤
开关打开:正常请求,且使用正常
开关关闭:无法请求,请求错误内容:
🚦 期望结果
按钮开关均能正常使用
📝 补充信息
因为docker启动指令支持了
XAI_API_KEY
环境变量,就想着试一下xAI,结果启动后请求错误。后面排查发现是因为关闭“使用客户端请求模式”功能后导致的,且docker启动环境变量中没找到指定开启“使用客户端请求模式”功能的内容(可能真的是有这个功能但是我没找到吧)。
另外官网的doc文档好像没有xAI相关的描述,还是翻了代码才找到的这个环境变量。