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? #1955

Closed
1 task done
Yanxueyu opened this issue May 9, 2024 · 8 comments
Closed
1 task done

大佬, 请问什么时候能接入 DeepSeek? #1955

Yanxueyu opened this issue May 9, 2024 · 8 comments
Labels
community tutorial Helpful tutorials or operational instructions by community members, may be outdated

Comments

@Yanxueyu
Copy link

Yanxueyu commented May 9, 2024

⚠️ 搜索是否存在类似issue

  • 我已经搜索过issues和disscussions,没有发现相似issue

总结

真的好便宜啊~ 测试了一段时间 感觉回复的质量也还行

举例

111111

动机

这个API巨便宜, 而且感觉他们的大模型做的也挺好的.

@lyy0755
Copy link

lyy0755 commented May 10, 2024

接口和openai的一样,把对应的api和url修改一下就行,openai模块里面的__init__.py

@XJTU-LiuYijun
Copy link

同问,我修改了以下三个地方
"model": "deepseek-chat",
"open_ai_api_key": "",
"open_ai_api_base":"https://api.deepseek.com/v1"
会报错
ModuleNotFoundError: No module named 'openai'

@lyy0755
Copy link

lyy0755 commented May 11, 2024

No module named 'openai',没装模块,init.py是openai模块的文件,这个文件在python模块包里面

@Yanxueyu
Copy link
Author

init 里面api 和 url 设置完还是报错了, :

Start auto replying.
[INFO][2024-05-13 02:47:05][chat_channel.py:117] - [WX]receive group at
[INFO][2024-05-13 02:47:05][bridge.py:61] - create bot chatGPT for chat
[INFO][2024-05-13 02:47:05][chat_gpt_bot.py:49] - [CHATGPT] query=测试
[ERROR][2024-05-13 02:47:05][chat_gpt_bot.py:155] - [CHATGPT] Exception: Incorrect API key provided: sk-493bd482b. You can find your API key at https://platform.openai.com/account/api-keys.
Traceback (most recent call last):
File "D:\Python_Pro\WeChatAI\chatgpt-on-wechat\bot\chatgpt\chat_gpt_bot.py", line 123, in reply_text
response = openai.ChatCompletion.create(api_key=api_key, messages=session.messages, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python_Pro\WeChatAI.venv\Lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python_Pro\WeChatAI.venv\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "D:\Python_Pro\WeChatAI.venv\Lib\site-packages\openai\api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python_Pro\WeChatAI.venv\Lib\site-packages\openai\api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "D:\Python_Pro\WeChatAI.venv\Lib\site-packages\openai\api_requestor.py", line 763, in _interpret_response_line
raise self.handle_error_response(
openai.error.AuthenticationError: Incorrect API key provided: sk-493bd
482b. You can find your API key at https://platform.openai.com/accou File "D:\Python_Pro\WeChatAI.venv\Lib\site-packages\openai\api_requestor.py", line 763, in _interpret_response_line
raise self.handle_error_response(
openai.error.AuthenticationError: Incorrect API key provided: sk-493bd
*******************482b. You can find your API key at https://platform.openai.com/account/api-keys.
[INFO][2024-05-13 02:47:06][wechat_channel.py:217] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR]
我现在有点累了,等会再来吧), receiver=@@1564c9ea34355971640d97991179deebda3c928806cb849eab788be4a42579da

@Playfullycat
Copy link

"open_ai_api_base":"https://api.deepseek.com/v1" ---> "open_ai_api_base":"https://api.deepseek.com"
用deepseek的话就别切模型了,切出去就切不回来了。。只能重启容器

@Yanxueyu
Copy link
Author

"open_ai_api_base":"https://api.deepseek.com/v1" ---> "open_ai_api_base":"https://api.deepseek.com" 用deepseek的话就别切模型了,切出去就切不回来了。。只能重启容器

init.py里试了也不行.
...
api_key = os.environ.get("DEEPSEEK_API_KEY")

Path of a file with an API key, whose contents can change. Supercedes

api_key if set. The main use case is volume-mounted Kubernetes secrets,

which are updated automatically.

api_key_path: Optional[str] = os.environ.get("OPENAI_API_KEY_PATH")

organization = os.environ.get("OPENAI_ORGANIZATION")
api_base = os.environ.get("DEEPSEEK_API_BASE", "https://api.deepseek.com")
api_type = os.environ.get("OPENAI_API_TYPE", "open_ai")
....
大佬你那边是改了什么, 可以帮忙告知下吗?

@Sectriwind
Copy link

compose里面加上
environment:
OPEN_AI_API_KEY: 'sk-'
MODEL: 'deepseek-chat'
open_ai_api_base: 'https://api.deepseek.com/v1'
即可,5.21号成功接入

@6vision
Copy link
Collaborator

6vision commented May 22, 2024

按照下面修改填写即可使用

"open_ai_api_key": "sk-589a4798c3a3d48fb74",
  "open_ai_api_base": "https://api.deepseek.com/v1",
  "model": "deepseek-chat",

@6vision 6vision closed this as completed May 22, 2024
@6vision 6vision added community tutorial Helpful tutorials or operational instructions by community members, may be outdated and removed status: needs check labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community tutorial Helpful tutorials or operational instructions by community members, may be outdated
Projects
None yet
Development

No branches or pull requests

6 participants