mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-11 22:58:08 +08:00
- Route `openai-response` source format requests to dedicated streaming and non-streaming responses handlers. - Add upstream URL resolution for Kimi Responses API endpoints based on auth attributes. - Normalize `openai-response` provider format to codex during thinking parameter resolution. Closes: #5400 #5571
22 lines
637 B
Go
22 lines
637 B
Go
package helps
|
|
|
|
import (
|
|
"strings"
|
|
|
|
kimiauth "github.com/router-for-me/CLIProxyAPI/v7/internal/auth/kimi"
|
|
cliproxyauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
|
|
)
|
|
|
|
// ResolveKimiResponsesURL resolves the upstream URL for Kimi Responses API requests.
|
|
func ResolveKimiResponsesURL(auth *cliproxyauth.Auth) string {
|
|
if auth != nil && auth.Attributes != nil {
|
|
if raw := strings.TrimRight(strings.TrimSpace(auth.Attributes["base_url"]), "/"); raw != "" {
|
|
if strings.HasSuffix(raw, "/v1") {
|
|
return raw + "/responses"
|
|
}
|
|
return raw + "/v1/responses"
|
|
}
|
|
}
|
|
return kimiauth.KimiAPIBaseURL + "/v1/responses"
|
|
}
|