File tree Expand file tree Collapse file tree 5 files changed +10
-0
lines changed
plugins/wasm-go/extensions/ai-proxy Expand file tree Collapse file tree 5 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,9 @@ func getApiName(path string) provider.ApiName {
358358 if strings .HasSuffix (path , "/v1/files" ) {
359359 return provider .ApiNameFiles
360360 }
361+ if strings .HasSuffix (path , "/v1/models" ) {
362+ return provider .ApiNameModels
363+ }
361364 // cohere style
362365 if strings .HasSuffix (path , "/v1/rerank" ) {
363366 return provider .ApiNameCohereV1Rerank
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
2020const (
2121 moonshotDomain = "api.moonshot.cn"
2222 moonshotChatCompletionPath = "/v1/chat/completions"
23+ moonshotModelsPath = "/v1/models"
2324)
2425
2526type moonshotProviderInitializer struct {
@@ -38,6 +39,7 @@ func (m *moonshotProviderInitializer) ValidateConfig(config *ProviderConfig) err
3839func (m * moonshotProviderInitializer ) DefaultCapabilities () map [string ]string {
3940 return map [string ]string {
4041 string (ApiNameChatCompletion ): moonshotChatCompletionPath ,
42+ string (ApiNameModels ): moonshotModelsPath ,
4143 }
4244}
4345
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ func (m *ollamaProviderInitializer) DefaultCapabilities() map[string]string {
3030 // ollama的chat接口path和OpenAI的chat接口一样
3131 string (ApiNameChatCompletion ): PathOpenAIChatCompletions ,
3232 string (ApiNameEmbeddings ): PathOpenAIEmbeddings ,
33+ string (ApiNameModels ): PathOpenAIModels ,
3334 }
3435}
3536
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const (
2121 defaultOpenaiEmbeddingsPath = "/v1/embeddings"
2222 defaultOpenaiAudioSpeech = "/v1/audio/speech"
2323 defaultOpenaiImageGeneration = "/v1/images/generations"
24+ defaultOpenaiModels = "/v1/models"
2425)
2526
2627type openaiProviderInitializer struct {
@@ -37,6 +38,7 @@ func (m *openaiProviderInitializer) DefaultCapabilities() map[string]string {
3738 string (ApiNameEmbeddings ): defaultOpenaiEmbeddingsPath ,
3839 string (ApiNameImageGeneration ): defaultOpenaiImageGeneration ,
3940 string (ApiNameAudioSpeech ): defaultOpenaiAudioSpeech ,
41+ string (ApiNameModels ): defaultOpenaiModels ,
4042 }
4143}
4244
Original file line number Diff line number Diff line change @@ -31,12 +31,14 @@ const (
3131 ApiNameAudioSpeech ApiName = "openai/v1/audiospeech"
3232 ApiNameFiles ApiName = "openai/v1/files"
3333 ApiNameBatches ApiName = "openai/v1/batches"
34+ ApiNameModels ApiName = "openai/v1/models"
3435
3536 PathOpenAICompletions = "/v1/completions"
3637 PathOpenAIChatCompletions = "/v1/chat/completions"
3738 PathOpenAIEmbeddings = "/v1/embeddings"
3839 PathOpenAIFiles = "/v1/files"
3940 PathOpenAIBatches = "/v1/batches"
41+ PathOpenAIModels = "/v1/models"
4042
4143 // TODO: 以下是一些非标准的API名称,需要进一步确认是否支持
4244 ApiNameCohereV1Rerank ApiName = "cohere/v1/rerank"
You can’t perform that action at this time.
0 commit comments