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

无法访问 deepseek api #443

Open
mainytht opened this issue Jan 2, 2025 · 4 comments
Open

无法访问 deepseek api #443

mainytht opened this issue Jan 2, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@mainytht
Copy link

mainytht commented Jan 2, 2025

重现步骤

同样的格式,通义千问的就可以, xrequest 看来有问题,使用 axios 直接请求就可以。
axios是这样用:
const BASE_URL = 'https://api.deepseek.com';
const PATH = '/chat/completions';
const MODEL = 'deepseek-chat';
const API_KEY = '*************';

当前行为

No response

预期行为

No response

上下文

No response

版本

最新的

您在哪些浏览器上遇到了这个问题?

No response

@mainytht mainytht added the bug Something isn't working label Jan 2, 2025
Copy link

根据您提供的信息,您在使用 xrequest 访问 Deepseek API 时遇到了问题,而使用 axios 直接请求则可以正常工作。以下是一些可能的解决方案和建议:

  1. 检查请求格式:确保 xrequest 的请求格式与 axios 的请求格式一致。特别是请求头、请求方法(GET、POST 等)和请求体。

  2. 调试信息:尝试在 xrequest 中添加调试信息,查看请求的完整信息和响应,以便更好地了解问题所在。

  3. 网络问题:确认网络连接是否正常,是否有防火墙或代理影响了请求。

  4. API Key:确保 API Key 是正确的,并且在请求中正确地传递。

  5. 版本问题:检查 xrequestaxios 的版本,确保使用的是最新版本,或者尝试回滚到已知稳定的版本。

如果这些建议无法解决问题,您可以提供更多的上下文信息或错误日志,以便更好地帮助您解决问题。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@YumoImer
Copy link
Collaborator

YumoImer commented Jan 3, 2025

报什么错?

@mainytht
Copy link
Author

mainytht commented Jan 5, 2025

POST https://api.deepseek.com/chat/completions 401 (Unauthorized)

User.tsx:264  onError Error: Fetch failed with status 401
at XFetch (x-fetch.js:34:11)
at async _XRequestClass.create (index.js:50:24)
at async request (User.tsx:240:9)

@YumoImer
Copy link
Collaborator

YumoImer commented Jan 6, 2025

看起来是权限问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants