feat(server): API relay gateway backend M0-M4
Gin + GORM + pure-Go SQLite. Users/auth (JWT), API key management with quotas, proxy gateway with weighted channel failover and health checks, usage/billing ledger, cross-protocol conversion (Anthropic Messages / OpenAI Chat Completions / OpenAI Responses), and channel/model admin API. Channels declare native API formats and auto-convert the rest. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b0c7439c01
commit
d0e31b198f
@@ -0,0 +1,17 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"openteam/server/internal/proxy/convert"
|
||||
)
|
||||
|
||||
// convertRequest translates a request body from the client protocol to the
|
||||
// channel provider's native format.
|
||||
func convertRequest(route Route, provider string, body []byte, upstreamModel string) ([]byte, error) {
|
||||
return convert.Request(clientProto(route), provider, body, upstreamModel)
|
||||
}
|
||||
|
||||
// convertResponse translates a non-stream upstream response back to the
|
||||
// client protocol.
|
||||
func convertResponse(route Route, provider string, body []byte) ([]byte, error) {
|
||||
return convert.Response(clientProto(route), provider, body)
|
||||
}
|
||||
Reference in New Issue
Block a user