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>
18 lines
601 B
Go
18 lines
601 B
Go
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)
|
|
}
|