hackathon-template/server/modules/chat/model.ts
2026-05-08 20:24:34 +12:00

21 lines
456 B
TypeScript

import { t, type UnwrapSchema } from "elysia";
export const ChatModel = {
chat: t.Object({
messages: t.Array(
t.Object({
id: t.String(),
role: t.Union([
t.Literal("user"),
t.Literal("assistant"),
t.Literal("system"),
]),
parts: t.Array(t.Any()),
}),
),
}),
} as const;
export type ChatModel = {
[k in keyof typeof ChatModel]: UnwrapSchema<(typeof ChatModel)[k]>;
};