oldweipro / claude-to-chatgpt Goto Github PK
View Code? Open in Web Editor NEWClaude 聊天接口适配到 OpenAI API 标准接口。
License: MIT License
Claude 聊天接口适配到 OpenAI API 标准接口。
License: MIT License
我自己部署了一套chatgpt-web。如何接入你这个项目呢?
如题,望大佬更新
能不能做个适配?看目前好像是没有这个功能
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3997275693/Dockerfile: no such file or directory
Hi, unsure how complicated or even technically possible, but would be appreciated if this could be adapted to accept input from OpenAI-Web GP-4. Hence possibly could work with front-ends that support Uploads via OpenAI-Web calls, eg: GPT-4-Code-Interpreter.
Thankyou for consideration, but completely understand if not possible.
我是用docker方式部署的,原代码无任何修改,dockerfile如下
lllFROM golang:1.20.3-alpine as builder
RUN go env -w GO111MODULE=on
RUN go env -w GOPROXY=https://goproxy.cn,direct
ENV CGO_ENABLED=0
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod tidy && go mod download
COPY . .
RUN go build -ldflags="-w -s" -o /app/claude-to-chatgpt .
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/claude-to-chatgpt .
COPY --from=builder /app/config.yaml .
EXPOSE 8787
CMD [ "./claude-to-chatgpt", "-c", "config.yaml" ]
0.0.1的时候可以直接部署成功,我也一直在用,后面尝试部署0.0.2后,接口返回出现如下报错
{
"error": {
"code": "500",
"details": "invalid character 'h' looking for beginning of value",
"message": "Unknown error",
"param": null,
"type": "internal_server_error"
}
}
docker日志报错,请忽略那两个代理报错,我原本不做任何修改想看看还会不会报错json解析问题,代理是可以正常访问claude的:
Unmarshal err: invalid character 'h' looking for beginning of value
目前情况是我即使重新部署0.1版本也是有相同报错,不知道是不是claude的响应结果变了
更新完今天的代码就报这个错了😂
[GIN-debug] Listening and serving HTTP on :8787
Unmarshal err: json: cannot unmarshal object into Go value of type []model.OrganizationsResponse
[GIN] 2023/07/29 - 11:54:12 | 500 | 159.984725ms | 10.10.0.3 | POST "/v1/chat/completions"
如题,应该是调用接口有什么特征泄漏,望大佬更新
有没有可能通过这样的适配,使用Claude2来替代AutoGPT中的ChatGPT4呢?如果可以的话,那项目能够运用的地方就多了。
{"error":{"code":"500","details":"claude错误","message":"claude错误","param":null,"type":"internal_server_error"}}
The cause:
claude-to-chatgpt/service/service.go
Line 40 in ca5a380
Fix:
See here st1vms/unofficial-claude-api@e2d1b57
好像API无法删除聊天,返回如下错误:
claude-to-chatgpt-api-1 | delete err: delete chat conversations errInternal Server Error xxxxxxxxx
claude-to-chatgpt-api-1 | [GIN] 2023/08/27 - 12:58:17 | 200 | 17.896308744s | 192.168.99.15 | POST "/v1/chat/completions"
claude-to-chatgpt-api-1 | delete err: delete chat conversations errInternal Server Error xxxxx
claude-to-chatgpt-api-1 | [GIN] 2023/08/27 - 12:59:24 | 200 | 5.202486228s | 192.168.99.15 | POST "/v1/chat/completions"
#!/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")
如题,使用docker内的ip (https://172.17.0.3:8787/v1) 无法调用,返回错误:
[CHATGPT] Bad Gateway: HTTP code 504 from API
claude2已经推出一段时间了,如题现在项目是否支持claude2
求更新windows打包版,之前的win一键包用不了了
如果我自己写的项目发送的时候带了api key,那我是不是不用在config文件里面去配置api?我现在两端都配置了。如果config不用配置那我就可以去掉了。我自己的项目又key池。
好像claude 对聊天请求数量有限制,聊一段时间就会429,太多的请求。直至等很长时间才恢复,大约等一两小时。
微笑😊
可以支持上上下文,现在都是单聊。
可以支持上调用传递Authorization header
curl --location 'http://api.claude.xxx.com/v1/chat/completions'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer xxx'
--data '{"temperature":0.5,"messages":[{"role":"user","content":"1+1=几"},{"role":"assistant","content":"你确定吗"}],"model":"gpt-3.5-turbo","max_tokens":3000}'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.