Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问这个是作为chatgpt接口代理吗? #1

Open
quangIELogEsIc opened this issue Mar 7, 2023 · 17 comments
Open

请问这个是作为chatgpt接口代理吗? #1

quangIELogEsIc opened this issue Mar 7, 2023 · 17 comments

Comments

@quangIELogEsIc
Copy link

No description provided.

@imyuanx
Copy link
Owner

imyuanx commented Mar 7, 2023

是的,通过部署到 Vercel 或者 Zeabur 通过他们提供的转发功能实现代理。

@Jackiexiao
Copy link

能支持 SSE吗,就是 stream=True 以便实时显示结果

@imyuanx
Copy link
Owner

imyuanx commented Mar 8, 2023

理论上来说是支持的,因为是完全转发,请问是遇到什么问题了吗

@imyuanx
Copy link
Owner

imyuanx commented Mar 8, 2023

你可以理解为我这个项目中用到的 Vercel / Zeabur 代替了他的项目中的 Docker、云函数,因为在 Vercel / Zeabur 上部署要更简单、方便,并且无需服务器

@Jackiexiao
Copy link

Nice 通过 open translator 实测支持 SSE

@popdo
Copy link

popdo commented Mar 16, 2023

Nice 通过 open translator 实测支持 SSE

如何实现呢?我请求参数传入stream:true 发现无法流式输出。我通过Cloudflare部署的另外一个代理能正常

@yigex
Copy link

yigex commented Mar 17, 2023

请问具体该如何使用呢 ?
我在python 的第三方库 openai 的源码中将原地址 https://api.openai.com/v1 替换为我在Zeabur 部署的 代理地址 , 但是无法正常发送请求 .

@imyuanx
Copy link
Owner

imyuanx commented Mar 18, 2023

Nice 通过 open translator 实测支持 SSE

如何实现呢?我请求参数传入stream:true 发现无法流式输出。我通过Cloudflare部署的另外一个代理能正常

晚点我来检查下

@imyuanx
Copy link
Owner

imyuanx commented Mar 18, 2023

请问具体该如何使用呢 ? 我在python 的第三方库 openai 的源码中将原地址 https://api.openai.com/v1 替换为我在Zeabur 部署的 代理地址 , 但是无法正常发送请求 .

https://xxx.zeabur.app/proxy会转发到https://api.openai.com/
没有后面的 /v1

@panda88666
Copy link

直接用zeabur的代理访问openai的接口会不会被封号呢?走的是国内的ip吗?

@imyuanx
Copy link
Owner

imyuanx commented Mar 18, 2023

直接用zeabur的代理访问openai的接口会不会被封号呢?走的是国内的ip吗?

理论上来说不会,国内 ip 有墙调不通接口,说明 Zeabur 的服务不在国内

@ToMatrgod
Copy link

没太理解这个意义在哪里,openai的api在国内本身就可以访问,只不过需要申请apikey。所以,为啥还要再部署一个代理去访问呢

@imyuanx
Copy link
Owner

imyuanx commented Mar 22, 2023

api 已经被墙了

@Lettingoo
Copy link

没太理解这个意义在哪里,openai的api在国内本身就可以访问,只不过需要申请apikey。所以,为啥还要再部署一个代理去访问呢

你在国内哪里访问的openai的api能直接访问?

@imyuanx
Copy link
Owner

imyuanx commented Mar 23, 2023

Nice 通过 open translator 实测支持 SSE

如何实现呢?我请求参数传入stream:true 发现无法流式输出。我通过Cloudflare部署的另外一个代理能正常

已支持流式输出

@willhamlam
Copy link

请问具体该如何使用呢 ? 我在python 的第三方库 openai 的源码中将原地址 https://api.openai.com/v1 替换为我在Zeabur 部署的 代理地址 , 但是无法正常发送请求 .

如果是你这种情况,需要把 OpenAI 的 API_BASE 改成 https://xxx.zeabur.app/proxy/v1, 这样子可以成功请求。我用 llama-index 用这个调整是可以实现代理请求的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants