Les boutons suivent la couleur d’apparence, les libellés trop petits ou trop techniques sont clarifiés, et le catalogue des fournisseurs se met à jour tout seul. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
773 B
TypeScript
24 lines
773 B
TypeScript
import { getAllowedByokProviders } from '@/lib/byok'
|
|
import { getLivePublicModels } from '@/lib/ai/live-public-catalog'
|
|
import { providerDisplayName } from '@/lib/ai/provider-labels'
|
|
|
|
const ENDPOINT_ONLY = new Set(['custom', 'custom_openai', 'custom_anthropic', 'anthropic_custom'])
|
|
|
|
export type PublicByokProvider = {
|
|
id: string
|
|
name: string
|
|
models: string[]
|
|
}
|
|
|
|
/** Catalogue public : fournisseurs BYOK Business, hors adresses perso. */
|
|
export async function getPublicByokCatalog(): Promise<PublicByokProvider[]> {
|
|
const liveModels = await getLivePublicModels()
|
|
return getAllowedByokProviders('BUSINESS')
|
|
.filter((id) => !ENDPOINT_ONLY.has(id))
|
|
.map((id) => ({
|
|
id,
|
|
name: providerDisplayName(id),
|
|
models: liveModels[id] ?? [],
|
|
}))
|
|
}
|