refactor(byok): move models suggestions list to server config models-list and fetch dynamically via API
This commit is contained in:
@@ -22,6 +22,8 @@ const createSchema = z.object({
|
||||
baseUrl: z.string().url().optional(),
|
||||
});
|
||||
|
||||
import { PROVIDER_MODEL_SUGGESTIONS } from '@/lib/ai/models-list';
|
||||
|
||||
export async function GET() {
|
||||
const session = await auth();
|
||||
if (!session?.user?.id) {
|
||||
@@ -36,6 +38,7 @@ export async function GET() {
|
||||
return NextResponse.json({
|
||||
keys: keys.map(toPublicApiKey),
|
||||
allowedProviders: getAllowedByokProviders(await getEffectiveTier(session.user.id)),
|
||||
providerModels: PROVIDER_MODEL_SUGGESTIONS,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user