Files
DocsGPT/frontend/src/conversation/conversationModels.ts
ajaythapliyal 19f807b6c4 refactors the conversation model from singular messages to queries
consisting of prompt and response
2023-03-05 16:29:10 +05:30

27 lines
491 B
TypeScript

export type MESSAGE_TYPE = 'QUESTION' | 'ANSWER' | 'ERROR';
export type Status = 'idle' | 'loading' | 'failed';
export type FEEDBACK = 'LIKE' | 'DISLIKE';
export interface Message {
text: string;
type: MESSAGE_TYPE;
}
export interface ConversationState {
queries: Query[];
status: Status;
}
export interface Answer {
answer: string;
query: string;
result: string;
}
export interface Query {
prompt: string;
response?: string;
feedback?: FEEDBACK;
error?: string;
}