zhayujie / bot-on-anything

Connect AI models (like ChatGPT-3.5/4.0, Baidu Yiyan, New Bing, Bard) to apps (like Wechat, public account, DingTalk, Telegram, QQ). 将 ChatGPT、必应、文心一言、谷歌Bard 等对话模型连接各类应用,如微信、公众号、QQ、Telegram、Gmail、Slack、Web、企业微信、飞书、钉钉等。
MIT License
3.89k stars 911 forks source link

已支持 ChatGPT API (gpt-3.5) #48

Open zzyspace opened 1 year ago

zzyspace commented 1 year ago

模型为gpt-3.5-turbo,文档: https://platform.openai.com/docs/guides/chat

amaoo commented 1 year ago

https://github.com/kydycode/chatgpt-3.5-turbo/

zhayujie commented 1 year ago

晚上更新

zwmcoder commented 1 year ago

晚上更新 openai默认就用gpt-3.5-turbo么, 看起来也便宜,也会迭代。 image

bboychencan commented 1 year ago

接口好改,主要是要存储上下文才能达到最优的效果,这部分工作量可能会大一些

kevinwatson2 commented 1 year ago

人机界面也要适当修改,使得用户可以输入两种queries,分别对应于下图中的system 和user,前者是新增的,不常变化,但对定位上下文很有用,后者类似于现在的或缺省。 image

chenweilie commented 1 year ago

是不是直接改就能暂时用上,不管上下文的话。

ronaldinho1000 commented 1 year ago

我刚才试了一下,反应速度确实快了很多,回答也更加智能一些;但是不一会,API 就无法使用了,提示http 443;openai 的库要升级到0.27.0 才行;

zhayujie commented 1 year ago

已支持 gpt-3.5-turbo 模型接入, 步骤如下:

  1. 获取最新代码 https://github.com/zhayujie/bot-on-anything
  2. 升级openai依赖,要求版本 0.27.0: pip3 install --upgrade openai
  3. 修改 config.json 中 model 部分的 type 为 chatgpt
zzyspace commented 1 year ago

Coooool!

ronaldinho1000 commented 1 year ago

2. pip3 install --upgrade openai

AttributeError: module 'openai' has no attribute 'ChatCompletion',我直接升级,报了这个错

zhayujie commented 1 year ago

pip3 install --upgrade openai

pip3 show openai 呢

ronaldinho1000 commented 1 year ago

pip3 install --upgrade openai

pip3 show openai 呢

图片

zhayujie commented 1 year ago

@ronaldinho1000 这样是ok的,你启动程序用的是 python3.8嘛

zhongjincan commented 1 year ago

我也出现了上面那个问题:AttributeError: module 'openai' has no attribute 'ChatCompletion',

ronaldinho1000 commented 1 year ago

是的,我用的是python3.8

ronaldinho1000 commented 1 year ago

@ronaldinho1000 这样是ok的,你启动程序用的是 python3.8嘛

我另外一台服务器是python 3.7.8,chatgpt 是可以正常使用的,只有这个服务器报错;

zhayujie commented 1 year ago

是的,我用的是python3.8

python3.8 app.py 还有这个问题嘛

explorerJi commented 1 year ago

root@iZ2ze00b429mg5da5v5xtdZ:~# pip3 show openai Name: openai Version: 0.26.5 Summary: Python client library for the OpenAI API Home-page: https://github.com/openai/openai-python Author: OpenAI Author-email: support@openai.com License: None Location: /usr/local/lib/python3.8/dist-packages Requires: requests, aiohttp, tqdm Required-by: 我这为什么安装不了更新呢,还是0.26.5版本,升不到0.27.0呢?大神,求解~

zhayujie commented 1 year ago

@explorerJi 升级下pip版本试试

zhongjincan commented 1 year ago

我也出现了上面那个问题:AttributeError: module 'openai' has no attribute 'ChatCompletion',

解决了,升级py版本

ronaldinho1000 commented 1 year ago

我也出现了上面那个问题:AttributeError: module 'openai' has no attribute 'ChatCompletion',

解决了,升级py版本

你升级到哪个py 版本了?

HUANGYIHAOLLL commented 1 year ago

国内是不是不能用了

yuanzhiyu commented 1 year ago

已使用新代码接入个人订阅号,服务器用的阿里云。用了一段时间之后突然阿里云->openAI的接口就一直超时了,但是我本地请求openAI接口有返回,是阿里云把openAI的接口检测到给ban了吗?

yuanzhiyu commented 1 year ago

真的无语,打个字的功夫,本地也请求超时了。

zzyspace commented 1 year ago

已使用新代码接入个人订阅号,服务器用的阿里云。用了一段时间之后突然阿里云->openAI的接口就一直超时了,但是我本地请求openAI接口有返回,是阿里云把openAI的接口检测到给ban了吗?

+1。甚至连GPT3都一起ban掉了

HUANGYIHAOLLL commented 1 year ago

已使用新代码接入个人订阅号,服务器用的阿里云。用了一段时间之后突然阿里云->openAI的接口就一直超时了,但是我本地请求openAI接口有返回,是阿里云把openAI的接口检测到给ban了吗?

+1。甚至连GPT3都一起ban掉了

已使用新代码接入个人订阅号,服务器用的阿里云。用了一段时间之后突然阿里云->openAI的接口就一直超时了,但是我本地请求openAI接口有返回,是阿里云把openAI的接口检测到给ban了吗?

我说我怎么用不了,太可恶了

zhayujie commented 1 year ago

腾讯云也访问不通了......

ronaldinho1000 commented 1 year ago

腾讯云也访问不通了......

太可恶了;全都用不了了

zhayujie commented 1 year ago

暂时通过开代理解决吧, 看看有没有其他办法

yuanzhiyu commented 1 year ago

暂时通过开代理解决吧, 看看有没有其他办法

已经开了 成功复活!

knigth95 commented 1 year ago

暂时通过开代理解决吧, 看看有没有其他办法

问一下,现在不开代理,是不是连GPT-3.0都无法用(我个人订阅号哪里一直在反馈:正在处理,请稍后再试)

zhayujie commented 1 year ago

暂时通过开代理解决吧, 看看有没有其他办法

问一下,现在不开代理,是不是连GPT-3.0都无法用(我个人订阅号哪里一直在反馈:正在处理,请稍后再试)

是的,一把封了

yuanzhiyu commented 1 year ago

大佬,我把你的线程池先注释掉了,换成了正常的一问一答的流程,发现99%的情况都不会有5s超时。因为如果第一次超时了,微信会连续发三次query。但是从实际体验来看,我的绝大多数回复都能在5s内返回。可能是新的api响应速度给优化了吧。

TheOnlySean commented 1 year ago

貌似model换到chatgpt后依然用的gpt-3,问了它很多次,它都说自己用的是gpt-3的语言模型,并说OpenAI还没有推出gpt-3.5

ShowUNow commented 1 year ago

貌似model换到chatgpt后仍然使用的gpt-3,问了很多次,它都说自己用的是gpt-3的语言模型,并说OpenAI还没有推出gpt-3.5

在openAI的官网https://platform.openai.com/account/usage 页面下面的Model usage上可以看到是调用了 gpt-3.5-turbo-0301 image

TheOnlySean commented 1 year ago

貌似model换到chatgpt后仍然使用的gpt-3,问了很多次,它都说自己用的是gpt-3的语言模型,并说OpenAI还没有推出gpt-3.5

在openAI的官网https://platform.openai.com/account/usage 页面下面的Model usage上可以看到是调用了 gpt-3.5-turbo-0301 image

还真是。。。

yuanzhiyu commented 1 year ago

貌似model换到chatgpt后依然用的gpt-3,问了它很多次,它都说自己用的是gpt-3的语言模型,并说OpenAI还没有推出gpt-3.5

你可以问一下时间,它还说现在是2021年呢。反正接口的模型肯定没那么好,接入必应的模型明显就好很多。

lkyuier commented 1 year ago

请问gpt3.5是不是收费的?

ShowUNow commented 1 year ago

是的,但是价格比之前的便宜十倍

lkl007 @.***> 于 2023年3月7日周二 20:44写道:

请问gpt3.5是不是收费的?

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/bot-on-anything/issues/48#issuecomment-1458109196, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3NDD44JL3HWG54Z3W52MWTW24USPANCNFSM6AAAAAAVMPOT64 . You are receiving this because you commented.Message ID: @.***>

Mrchenvvv commented 1 year ago

现在

暂时通过开代理解决吧, 看看有没有其他办法

问一下,现在不开代理,是不是连GPT-3.0都无法用(我个人订阅号哪里一直在反馈:正在处理,请稍后再试)

是的,一把封了

现在是必须开代理才能访问openai的api的吗?

ShowUNow commented 1 year ago

是的

Mrchenvvv @.***> 于 2023年3月8日周三 15:17写道:

现在

暂时通过开代理解决吧, 看看有没有其他办法

问一下,现在不开代理,是不是连GPT-3.0都无法用(我个人订阅号哪里一直在反馈:正在处理,请稍后再试)

是的,一把封了

现在是必须开代理才能访问openai的api的吗?

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/bot-on-anything/issues/48#issuecomment-1459649322, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3NDD465CECPTK5FL25UBJTW3AXAXANCNFSM6AAAAAAVMPOT64 . You are receiving this because you commented.Message ID: @.***>

xin007-kong commented 1 year ago

貌似model换到chatgpt后依然用的gpt-3,问了它很多次,它都说自己用的是gpt-3的语言模型,并说OpenAI还没有推出gpt-3.5

你可以问一下时间,它还说现在是2021年呢。反正接口的模型肯定没那么好,接入必应的模型明显就好很多。

必应的模型已经可以接入了吗?

xionghaizhi commented 1 year ago

貌似model换到chatgpt后依然用的gpt-3,问了它很多次,它都说自己用的是gpt-3的语言模型,并说OpenAI还没有推出gpt-3.5

你可以问一下时间,它还说现在是2021年呢。反正接口的模型肯定没那么好,接入必应的模型明显就好很多。

接入后怎么让他走clash?

tengzhaoyong commented 8 months ago
  1. pip3 install --upgrade openai

AttributeError: module 'openai' has no attribute 'ChatCompletion',我直接升级,报了这个错

我也是,然后我用python3.8就可以了,之前一直是python3.6