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)
	}
}
