linweiyuan / go-chatgpt-api

一个尝试绕过 Cloudflare 来使用 ChatGPT 接口的程序
MIT License
1.43k stars 445 forks source link

能否配合 https://github.com/binary-husky/gpt_academic 使用? #235

Closed hongyi-zhao closed 1 year ago

hongyi-zhao commented 1 year ago

能否配合 https://github.com/binary-husky/gpt_academic 使用?即基于本项目实现下面的反代:

https://github.com/binary-husky/gpt_academic/blob/37afcc709bfcd34e7ef9a25ab06347395c62a445/config.py#L35C1-L38C22

# 重新URL重新定向,实现更换API_URL的作用(高危设置! 常规情况下不要修改! 通过修改此设置,您将把您的API-KEY和对话隐私完全暴露给您设定的中间人!)
# 格式: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "在这里填写重定向的api.openai.com的URL"} 
# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions"}
API_URL_REDIRECT = {}

See https://github.com/binary-husky/gpt_academic/issues/900#issuecomment-1658463065 for the related discussion.

linweiyuan commented 1 year ago

API_URL_REDIRECT = {https://你的服务/platform/v1/chat/completions}

https://github.com/linweiyuan/go-chatgpt-api/blob/main/example/vscode/platform.http#L18-L36

M1saka10010 commented 1 year ago

在余额过期的账号中platform提示余额不足,imitate提示write: broken pipe,请问怎么解决?

linweiyuan commented 1 year ago

你知道 imitate 接口是用来做什么的吗

M1saka10010 commented 1 year ago

你知道 imitate 接口是用来做什么的吗

不是用来chatgpt转api的吗?我自己post可用,但是不知道为啥填进gpt_academic里就broken pipe

hongyi-zhao commented 1 year ago

将 gpt_academic 更新到最新版本,然后参考我的测试方法

M1saka10010 commented 1 year ago

参考我下面的测试方法:

binary-husky/gpt_academic#1014 (comment)

还是broken pipe,不知道什么东西,可能跟我都使用docker部署有关

hongyi-zhao commented 1 year ago

设置下面的了吗? image

M1saka10010 commented 1 year ago

设置下面的了吗? image

可以了,好得也莫名其妙的

hongyi-zhao commented 1 year ago

https://github.com/binary-husky/gpt_academic/wiki/%E7%AC%AC%E4%B8%89%E6%96%B9API%E2%80%90KEY%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97#%E7%89%B9%E4%BE%8B2-chatgpt-to-api image