🚀 feat(auth): support new model API paths in authentication and routing
- Updated TokenAuth middleware to handle requests for both `/v1beta/models/` and `/v1/models/`. - Adjusted distributor middleware to recognize the new model path. - Enhanced relay mode determination to include the new model path. - Added route for handling POST requests to `/models/*path`. These changes ensure compatibility with the new model API structure, improving the overall routing and authentication flow.
This commit is contained in:
@@ -80,7 +80,7 @@ func Path2RelayMode(path string) int {
|
||||
relayMode = RelayModeRerank
|
||||
} else if strings.HasPrefix(path, "/v1/realtime") {
|
||||
relayMode = RelayModeRealtime
|
||||
} else if strings.HasPrefix(path, "/v1beta/models") {
|
||||
} else if strings.HasPrefix(path, "/v1beta/models") || strings.HasPrefix(path, "/v1/models") {
|
||||
relayMode = RelayModeGemini
|
||||
}
|
||||
return relayMode
|
||||
|
||||
Reference in New Issue
Block a user