feat: dynamic model discovery from vercel ai gateway (#1353)

This commit is contained in:
josh 2025-12-14 21:26:49 +00:00 committed by GitHub
parent 2b0b42d144
commit b1da86062e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 7426 additions and 2277 deletions

View file

@ -1,7 +1,7 @@
import { streamObject } from "ai";
import { z } from "zod";
import { sheetPrompt, updateDocumentPrompt } from "@/lib/ai/prompts";
import { myProvider } from "@/lib/ai/providers";
import { getArtifactModel } from "@/lib/ai/providers";
import { createDocumentHandler } from "@/lib/artifacts/server";
export const sheetDocumentHandler = createDocumentHandler<"sheet">({
@ -10,7 +10,7 @@ export const sheetDocumentHandler = createDocumentHandler<"sheet">({
let draftContent = "";
const { fullStream } = streamObject({
model: myProvider.languageModel("artifact-model"),
model: getArtifactModel(),
system: sheetPrompt,
prompt: title,
schema: z.object({
@ -49,7 +49,7 @@ export const sheetDocumentHandler = createDocumentHandler<"sheet">({
let draftContent = "";
const { fullStream } = streamObject({
model: myProvider.languageModel("artifact-model"),
model: getArtifactModel(),
system: updateDocumentPrompt(document.content, "sheet"),
prompt: description,
schema: z.object({