feat(agent): route chat through selected model

This commit is contained in:
ginnoir
2026-07-08 16:34:22 -05:00
parent bf7e07ead9
commit 9b7a04431c
6 changed files with 78 additions and 4 deletions
+7
View File
@@ -1,4 +1,5 @@
import { z } from "zod";
import { isValidLlmModelId } from "@/lib/llm/models";
export const clientChatAttachmentSchema = z.object({
type: z.literal("image"),
@@ -11,8 +12,14 @@ export const clientChatMessageSchema = z.object({
attachments: z.array(clientChatAttachmentSchema).max(3).optional(),
});
export const clientChatModelSchema = z
.string()
.trim()
.refine((value) => isValidLlmModelId(value), "Invalid assistant model");
export const clientChatInputSchema = z.object({
stream: z.boolean().optional(),
model: clientChatModelSchema.optional(),
messages: z.array(clientChatMessageSchema).min(1).max(40),
});