Browse Source
- ChatRole, ChatMessage, ConversationState types - ChatRequest for /api/chat endpoint - Minimal types (Vercel AI SDK provides its own)handoff-20260429-1057
1 changed files with 39 additions and 0 deletions
@ -0,0 +1,39 @@ |
|||||
|
/** |
||||
|
* Chat Types |
||||
|
* |
||||
|
* Types for the conversational workflow planning interface. |
||||
|
*/ |
||||
|
|
||||
|
/** Role in conversation */ |
||||
|
export type ChatRole = 'user' | 'assistant' | 'system'; |
||||
|
|
||||
|
/** Single message in conversation */ |
||||
|
export interface ChatMessage { |
||||
|
/** Unique message ID */ |
||||
|
id: string; |
||||
|
/** Who sent the message */ |
||||
|
role: ChatRole; |
||||
|
/** Message content (markdown supported) */ |
||||
|
content: string; |
||||
|
/** When message was created */ |
||||
|
createdAt: Date; |
||||
|
} |
||||
|
|
||||
|
/** State of the chat conversation */ |
||||
|
export interface ConversationState { |
||||
|
/** All messages in the conversation */ |
||||
|
messages: ChatMessage[]; |
||||
|
/** Whether AI is currently responding */ |
||||
|
isLoading: boolean; |
||||
|
/** Current error if any */ |
||||
|
error: string | null; |
||||
|
} |
||||
|
|
||||
|
/** Request body for /api/chat */ |
||||
|
export interface ChatRequest { |
||||
|
/** Message history */ |
||||
|
messages: Array<{ |
||||
|
role: ChatRole; |
||||
|
content: string; |
||||
|
}>; |
||||
|
} |
||||
Loading…
Reference in new issue