fix import (#242)

* 🐛 fix import (#224)

* 🐛 fix import of corrupted history

see https://github.com/mckaywrigley/chatbot-ui/issues/224#issuecomment-1486080888

* add the run-test-suite github action
This commit is contained in:
Thomas LÉVEIL
2023-03-28 10:27:37 +02:00
committed by GitHub
parent 5aa5be3f43
commit b0c289f7a4
15 changed files with 7061 additions and 55 deletions
+36
View File
@@ -0,0 +1,36 @@
import { Conversation, Message } from './chat';
import { Folder } from './folder';
import { OpenAIModel } from './openai';
export type SupportedExportFormats =
| ExportFormatV1
| ExportFormatV2
| ExportFormatV3;
export type LatestExportFormat = ExportFormatV3;
////////////////////////////////////////////////////////////////////////////////////////////
interface ConversationV1 {
id: number;
name: string;
messages: Message[];
}
export type ExportFormatV1 = ConversationV1[];
////////////////////////////////////////////////////////////////////////////////////////////
interface ChatFolder {
id: number;
name: string;
}
export interface ExportFormatV2 {
history: Conversation[] | null;
folders: ChatFolder[] | null;
}
////////////////////////////////////////////////////////////////////////////////////////////
export interface ExportFormatV3 {
version: 3;
history: Conversation[];
folders: Folder[];
}