-
Notifications
You must be signed in to change notification settings - Fork 663
ai-proxy plugin: add rerank api for openai compabable extend #2205
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
base: main
Are you sure you want to change the base?
Conversation
暂时插件测试还没有通过,先不要合并 |
@@ -22,6 +22,7 @@ const ( | |||
defaultOpenaiAudioSpeech = "/v1/audio/speech" | |||
defaultOpenaiImageGeneration = "/v1/images/generations" | |||
defaultOpenaiModels = "/v1/models" | |||
defaultOpenaiExtendRerankPath = "/v1/rerank" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面的变量名字都没有 Path 字样,这里可以考虑去掉。
caps := m.DefaultCapabilities() | ||
|
||
// 添加新的项 | ||
caps[string(ApiNameOpenaiExtendRerank)] = defaultOpenaiExtendRerankPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释和空行可以删掉,代码本身已经比较容易理解了
@@ -42,6 +42,7 @@ const ( | |||
|
|||
// TODO: 以下是一些非标准的API名称,需要进一步确认是否支持 | |||
ApiNameCohereV1Rerank ApiName = "cohere/v1/rerank" | |||
ApiNameOpenaiExtendRerank ApiName = "openai/v1/rerank" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里要格式化一下
麻烦 rebase 一下 main 分支。 |
Ⅰ. Describe what this PR did
为openai 兼容性扩展 增加rerank接口
Ⅱ. Does this pull request fix one issue?
fixes #2168
Ⅲ. Why don't you add test cases (unit test/integration test)?
手动进行插件测试
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews