Ink-Osier / PandoraToV1Api

站在巨人的肩膀上的项目,感谢zhile大佬的Pandora-Next项目
517 stars 106 forks source link

如何使用chatgpt-next-web 以外的项目 #27

Closed dashixiong-11 closed 6 months ago

dashixiong-11 commented 6 months ago

比如别的项目的请求路径是 /api/openai/chat, 如何代理到 Pandora-Next 项目上 是需要改源码吗 我使用的项目是 https://github.com/lobehub/lobe-chat.git

Ink-Osier commented 6 months ago

是的,本项目暂时只支持官方格式的v1接口的输入

dashixiong-11 commented 6 months ago

是的,本项目暂时只支持官方格式的v1接口的输入

考不考虑再加个配置参数,自定义代理的请求路径啊,方便任何接口对接,只要参数一样就行

Ink-Osier commented 6 months ago

可以是可以,不过这个nginx其实就可以实现,后续会考虑这个功能,但是建议先用nginx反代

Ink-Osier commented 6 months ago

因为需求相对小众,如果有其他比较急的需求会排在相对后边

Ink-Osier commented 6 months ago

或者也推荐fork项目后修改一下v1的请求路径就可以

Ink-Osier commented 6 months ago

而且我记得lobechat也支持v1吧,群里有小伙伴用过

dashixiong-11 commented 6 months ago

而且我记得lobechat也支持v1吧,群里有小伙伴 用过

这是他的配置 OPENAI_PROXY_URL=https://api.openai.com/v1 , 请求路径是 /api/openai/chat , 所以他实际请求的是https://api.openai.com/v1/api/openai/chat , 如果设置OPENAI_PROXY_URL = http://localhost:50011 那么请求的就是http://localhost:50011/api/openai/chat ,但是只有请求http://localhost:50011/v1/chat/completions 待会被代理过去 ,是这样理解的吗,我比较新手 老哥顺便分享一下群 T T

Ink-Osier commented 6 months ago

我没用过这个项目,可以进release或者readme里的群聊里和小伙伴沟通一下,看看具体是哪里的问题,如果确认真的必须要加一个这个接口后续会加上,但是尽可能还是希望保证这个项目避免过于冗余的功能

dashixiong-11 commented 6 months ago

我没用过这个项目,可以进release或者readme里的群聊里和小伙伴沟通一下,看看具体是哪里的问题,如果确认真的必须要加一个这个接口后续会加上,但是尽可能还是希望保证这个项目避免过于冗余的功能

老哥 项目成功启动之后 只要请求 符合 http://localhost:50011/v1/chat/completions 这个格式都能命中代理吗

Ink-Osier commented 6 months ago

是的

Ink-Osier commented 6 months ago

支持gpt-4-vision-preview官方格式的调用,如果你想问的是这个