OpenAI-compatible AI gateway with Vue admin UI, multi-provider egress, ingress key governance, monitoring, and security controls. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"github.com/rose_cat707/luminary/internal/model"
|
||||
"github.com/rose_cat707/luminary/internal/provider"
|
||||
"github.com/rose_cat707/luminary/internal/provider/anthropic"
|
||||
"github.com/rose_cat707/luminary/internal/provider/custom"
|
||||
"github.com/rose_cat707/luminary/internal/provider/openai"
|
||||
)
|
||||
|
||||
func parseUint(s string) uint {
|
||||
v, _ := strconv.ParseUint(s, 10, 64)
|
||||
return uint(v)
|
||||
}
|
||||
|
||||
func (h *Handler) gatewayClient(t model.ProviderType) (provider.Client, error) {
|
||||
switch t {
|
||||
case model.ProviderOpenAI, model.ProviderAzureOpenAI, model.ProviderOpenRouter, model.ProviderOllama:
|
||||
return openai.New(), nil
|
||||
case model.ProviderAnthropic:
|
||||
return anthropic.New(), nil
|
||||
case model.ProviderCustom:
|
||||
return custom.New(), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported provider type: %s", t)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user