feat: v1 — persistent shell, model gateway, artifact improvements (#1462)
This commit is contained in:
parent
3651670fb9
commit
f9652b452a
161 changed files with 5166 additions and 8009 deletions
20
app/(chat)/api/models/route.ts
Normal file
20
app/(chat)/api/models/route.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { getAllGatewayModels, getCapabilities, isDemo } from "@/lib/ai/models";
|
||||
|
||||
export async function GET() {
|
||||
const headers = {
|
||||
"Cache-Control": "public, max-age=86400, s-maxage=86400",
|
||||
};
|
||||
|
||||
const curatedCapabilities = await getCapabilities();
|
||||
|
||||
if (isDemo) {
|
||||
const models = await getAllGatewayModels();
|
||||
const capabilities = Object.fromEntries(
|
||||
models.map((m) => [m.id, curatedCapabilities[m.id] ?? m.capabilities])
|
||||
);
|
||||
|
||||
return Response.json({ capabilities, models }, { headers });
|
||||
}
|
||||
|
||||
return Response.json(curatedCapabilities, { headers });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue