package bootstrap

import "ai-css/library/modelprovider/consts"

var Providers = []consts.ProviderMeta{
	{ID: consts.ProviderIDOpenAI, Name: consts.ProviderOpenAI, Display: "OpenAI", Official: true},
}

var providerByName = make(map[consts.ProviderName]consts.ProviderMeta)
var providerByID = make(map[consts.ProviderID]consts.ProviderMeta)

func init() {
	for _, p := range Providers {
		providerByName[p.Name] = p
		providerByID[p.ID] = p
	}
}

func GetProviderByName(name consts.ProviderName) (consts.ProviderMeta, bool) {
	p, ok := providerByName[name]
	return p, ok
}

func GetProviderByID(id consts.ProviderID) (consts.ProviderMeta, bool) {
	p, ok := providerByID[id]
	return p, ok
}
