Add AI chat feature
This commit is contained in:
parent
80056b3728
commit
6a5041be43
15 changed files with 1259 additions and 2 deletions
21
server/modules/chat/model.ts
Normal file
21
server/modules/chat/model.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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]>;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue