Git Product home page Git Product logo

Comments (9)

Sectriwind avatar Sectriwind commented on June 8, 2024 1

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

from chatgpt-on-wechat.

lyy0755 avatar lyy0755 commented on June 8, 2024

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

from chatgpt-on-wechat.

XJTU-LiuYijun avatar XJTU-LiuYijun commented on June 8, 2024

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

from chatgpt-on-wechat.

lyy0755 avatar lyy0755 commented on June 8, 2024

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

from chatgpt-on-wechat.

Yanxueyu avatar Yanxueyu commented on June 8, 2024

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

from chatgpt-on-wechat.

Playfullycat avatar Playfullycat commented on June 8, 2024

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

from chatgpt-on-wechat.

Yanxueyu avatar Yanxueyu commented on June 8, 2024

"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")
....
大佬你那边是改了什么, 可以帮忙告知下吗?

from chatgpt-on-wechat.

6vision avatar 6vision commented on June 8, 2024

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

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

from chatgpt-on-wechat.

Yanxueyu avatar Yanxueyu commented on June 8, 2024

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

可以了, 非常感谢大佬! 很奇怪为什么 docker部署启动可以, 但 app.py运行就不行...config都是按照 deepseek官方指导的去配置的.

from chatgpt-on-wechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.