oldweipro / claude-to-chatgpt

Claude 聊天接口适配到 OpenAI API 标准接口。
MIT License
102 stars 18 forks source link

claude2 500错误 #17

Open Joackk opened 12 months ago

Joackk commented 12 months ago

访问时候得到如下错误: image 测试的py脚本如下

#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
#@time : 2023/08/19 13:23:48

import openai

openai.api_key = ""
openai.api_base = "http://127.0.0.1:8787/v1"

while True:
    text = input("请输入问题:")
    response = openai.ChatCompletion.create(
        model='gpt-4',
        messages=[
            {'role': 'user', 'content': text},
        ],
        stream=True,
        allow_fallback=True
    )

    for chunk in response:
        print(chunk.choices[0].delta.get("content", ""), end="", flush=True)
    print("\n")
Joackk commented 12 months ago

提示的错误信息如下: Unknown error {"error":{"code":"500","details":"Get \"https://claude.ai/api/organizations\": read tcp 198.18.0.1:64215-\u003e192.168.1.2:7890: wsarecv: An existing connection was forcibly closed by the remote host.","message":"Unknown error","param":null,"type":"internal_server_error"}} 500 {'error': {'code': '500', 'details': 'Get "https://claude.ai/api/organizations": read tcp 198.18.0.1:64215->192.168.1.2:7890: wsarecv: An existing connection was forcibly closed by the remote host.', 'message': 'Unknown error', 'param': None, 'type': 'internal_server_error'}} {'Access-Control-Allow-Headers': '*', 'Access-Control-Allow-Methods': '*', 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json; charset=utf-8', 'Date': 'Tue, 19 Sep 2023 12:13:39 GMT', 'Content-Length': '273'}

oldweipro commented 11 months ago

使用新版本试一下,docker已同步更新了

spammenotinoz commented 11 months ago

Fixed with the latest version. Curious is there any difference between GPT-3.5 and GPT-4 with this Claude to GPT?

oldweipro commented 11 months ago

Fixed with the latest version. Curious is there any difference between GPT-3.5 and GPT-4 with this Claude to GPT?

There is no difference, because in the end, the Claude interface is called and the Claude model is used

spammenotinoz commented 11 months ago

Fixed with the latest version. Curious is there any difference between GPT-3.5 and GPT-4 with this Claude to GPT?

There is no difference, because in the end, the Claude interface is called and the Claude model is used

Thank-you