schema.ts•615 B
// Message role enum type
export enum MessageRole {
USER = "user",
ASSISTANT = "assistant",
TOOL = "tool",
}
// Types for structured message content
export type MessagePart = {
type: string;
text?: string;
toolCallId?: string;
toolName?: string;
args?: any;
result?: any;
[key: string]: any;
};
export type Attachment = {
type: string;
[key: string]: any;
};
export type Chat = {
id: string;
userId: string;
title: string;
createdAt: Date;
updatedAt: Date;
};
export type Message = {
id: string;
chatId: string;
role: string;
parts: MessagePart[];
createdAt: Date;
};