Skip to content

Type Alias: ChatMessage

type ChatMessage =
| {
createdAt: number;
dbId: string;
goal: string;
id: string;
role: "user";
userId: string;
}
| {
createdAt: number;
dbId: string;
id: string;
result: ChatAssistantResult;
role: "assistant";
userId: string;
};

Defined in: packages/sdk/src/index.ts:533

One persisted chat turn; the role discriminant narrows to a user prompt vs an assistant result.