chatgpt-on-wechat icon indicating copy to clipboard operation
chatgpt-on-wechat copied to clipboard

gpt-4o提示不存在

Open joewen85 opened this issue 1 year ago • 5 comments

前置确认

  • [X] 我确认我运行的是最新版本的代码,并且安装了所需的依赖,在FAQS中也未找到类似问题。

⚠️ 搜索issues中是否已存在类似问题

  • [X] 我已经搜索过issues和disscussions,没有跟我遇到的问题相关的issue

操作系统类型?

MacOS

运行的python版本是?

python 3.10

使用的chatgpt-on-wechat版本是?

Master (branch)

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

配置config.json中的proxy. 已确保proxy可用. 并配置open_ai_api_key

网页端openai账号正常可用

项目中请求返回 openai.error.InvalidRequestError: The model gpt-4o does not exist or you do not have access to it.

问题描述 😯

配置config.json中的proxy. 已确保proxy可用. 并配置open_ai_api_key

网页端openai账号正常可用

本地运行项目 使用curl测试访问openai接口

curl -I -v https://api.openai.com/v1
* Uses proxy env variable all_proxy == 'http://127.0.0.1:49922'
*   Trying 127.0.0.1:49922...
* Connected to 127.0.0.1 (127.0.0.1) port 49922
* CONNECT tunnel: HTTP/1.1 negotiated
* allocate connect buffer
* Establish HTTP proxy tunnel to api.openai.com:443
> CONNECT api.openai.com:443 HTTP/1.1
> Host: api.openai.com:443
> User-Agent: curl/8.6.0
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 Connection established
HTTP/1.1 200 Connection established
< 

* CONNECT phase completed
* CONNECT tunnel established, response 200
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=api.openai.com
*  start date: May  1 23:05:16 2024 GMT
*  expire date: Jul 30 23:05:15 2024 GMT
*  subjectAltName: host "api.openai.com" matched cert's "api.openai.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1P5
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://api.openai.com/v1
* [HTTP/2] [1] [:method: HEAD]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: api.openai.com]
* [HTTP/2] [1] [:path: /v1]
* [HTTP/2] [1] [user-agent: curl/8.6.0]
* [HTTP/2] [1] [accept: */*]
> HEAD /v1 HTTP/2
> Host: api.openai.com
> User-Agent: curl/8.6.0
> Accept: */*
> 
< HTTP/2 404 
HTTP/2 404 
< date: Tue, 14 May 2024 06:57:11 GMT
date: Tue, 14 May 2024 06:57:11 GMT
< content-type: application/octet-stream
content-type: application/octet-stream
< content-length: 251
content-length: 251
< strict-transport-security: max-age=15724800; includeSubDomains
strict-transport-security: max-age=15724800; includeSubDomains
< cf-cache-status: DYNAMIC
cf-cache-status: DYNAMIC
< set-cookie: __cf_bm=j7MyKNsvY5e5_9IUuEXscxg4eyHx1UIErkYPTlao3Y8-1715669831-1.0.1.1-oqFB_ihizngv0OT3sA1GtU9S.Bade19WZzK_VH16Kmk3eJhkSQwsl4m.0AYSBIAN86CzEG749I__ZmuHpRPbIw; path=/; expires=Tue, 14-May-24 07:27:11 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
set-cookie: __cf_bm=j7MyKNsvY5e5_9IUuEXscxg4eyHx1UIErkYPTlao3Y8-1715669831-1.0.1.1-oqFB_ihizngv0OT3sA1GtU9S.Bade19WZzK_VH16Kmk3eJhkSQwsl4m.0AYSBIAN86CzEG749I__ZmuHpRPbIw; path=/; expires=Tue, 14-May-24 07:27:11 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
< set-cookie: _cfuvid=O9.ZLIamKewMoSgwf9xWKPOq3RIjQ2Yq60bQAejAKJ8-1715669831974-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=O9.ZLIamKewMoSgwf9xWKPOq3RIjQ2Yq60bQAejAKJ8-1715669831974-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
< server: cloudflare
server: cloudflare
< cf-ray: 8838fe20bc14684f-NRT
cf-ray: 8838fe20bc14684f-NRT
< alt-svc: h3=":443"; ma=86400
alt-svc: h3=":443"; ma=86400

项目中请求 image

openai.error.InvalidRequestError: The model gpt-4o does not exist or you do not have access to it.

不清楚是否openai包太旧, 网上使用的proxy的范例包都是 >=1.2.x

终端日志 📒

[INFO][2024-05-14 14:55:29][chat_gpt_bot.py:51] - [CHATGPT] query=iphone出到第几代
[ERROR][2024-05-14 14:55:30][chat_gpt_bot.py:157] - [CHATGPT] Exception: The model `gpt-4o` does not exist or you do not have access to it.
Traceback (most recent call last):
  File "/Users/joe/projects/chatgpt-on-wechat/bot/chatgpt/chat_gpt_bot.py", line 125, in reply_text
    response = openai.ChatCompletion.create(api_key=api_key, messages=session.messages, **args)
  File "/Users/joe/projects/chatgpt-on-wechat/venv/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "/Users/joe/projects/chatgpt-on-wechat/venv/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "/Users/joe/projects/chatgpt-on-wechat/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request
    resp, got_stream = self._interpret_response(result, stream)
  File "/Users/joe/projects/chatgpt-on-wechat/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response
    self._interpret_response_line(
  File "/Users/joe/projects/chatgpt-on-wechat/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: The model `gpt-4o` does not exist or you do not have access to it.
[INFO][2024-05-14 14:55:30][wechat_channel.py:217] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR]
我现在有点累了,等会再来吧),xxx

joewen85 avatar May 14 '24 07:05 joewen85

碰到同样的问题

dale0110 avatar May 14 '24 14:05 dale0110

我的没更新,但是gpt4o可以正常使用

glasscatya avatar May 14 '24 15:05 glasscatya

我的没更新,但是gpt4o可以正常使用

你是plus会员吗?我不是plus会员,我在OpenAI网站无法看到gpt-4o模型,看来OpenAI没有对所有人开放gpt-4o

dale0110 avatar May 15 '24 00:05 dale0110

我的没更新,但是gpt4o可以正常使用

你是plus会员吗?我不是plus会员,我在OpenAI网站无法看到gpt-4o模型,看来OpenAI没有对所有人开放gpt-4o

如果有权限的时候,访问chat.openai.com页面的时候,会通知你的。 image

Ngwind avatar May 16 '24 08:05 Ngwind

我也是同样的问题,唯一不同的是我有gpt4o的使用权限

xsnull avatar May 18 '24 14:05 xsnull

只要api key有权限接入,是没问题的,和openai sdk版本无关

6vision avatar May 21 '24 06:05 6vision