44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { UserList } from '../lists/lists.models';
|
|
import { ListTemplate } from '../templates/templates.models';
|
|
|
|
export type AssistantMessageRole = 'user' | 'assistant';
|
|
|
|
export interface AssistantChatMessage {
|
|
role: AssistantMessageRole;
|
|
content: string;
|
|
}
|
|
|
|
export type AssistantAction =
|
|
| {
|
|
type: 'list.created';
|
|
listId: string;
|
|
list: UserList;
|
|
}
|
|
| {
|
|
type: 'list.item_added';
|
|
listId: string;
|
|
itemTitle: string;
|
|
list: UserList;
|
|
};
|
|
|
|
export interface AssistantChatRequest {
|
|
messages: AssistantChatMessage[];
|
|
context?: AssistantPageContext;
|
|
}
|
|
|
|
export type AssistantPageContext =
|
|
| { page: 'lists_overview'; route: string }
|
|
| { page: 'list_detail'; route: string; list: UserList }
|
|
| { page: 'templates_overview'; route: string }
|
|
| { page: 'template_detail'; route: string; template: ListTemplate }
|
|
| { page: 'unknown'; route: string };
|
|
|
|
export interface AssistantChatResponse {
|
|
message: AssistantChatMessage;
|
|
actions: AssistantAction[];
|
|
}
|
|
|
|
export interface AssistantConversationMessage extends AssistantChatMessage {
|
|
actions?: AssistantAction[];
|
|
}
|