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:
+7
-2
@@ -36,13 +36,18 @@ export const cleanSelectedConversation = (conversation: Conversation) => {
|
||||
return updatedConversation;
|
||||
};
|
||||
|
||||
export const cleanConversationHistory = (history: Conversation[]) => {
|
||||
export const cleanConversationHistory = (history: any[]): Conversation[] => {
|
||||
// added model for each conversation (3/20/23)
|
||||
// added system prompt for each conversation (3/21/23)
|
||||
// added folders (3/23/23)
|
||||
// added prompts (3/26/23)
|
||||
|
||||
return history.reduce((acc: Conversation[], conversation) => {
|
||||
if (!Array.isArray(history)) {
|
||||
console.warn('history is not an array. Returning an empty array.');
|
||||
return [];
|
||||
}
|
||||
|
||||
return history.reduce((acc: any[], conversation) => {
|
||||
try {
|
||||
if (!conversation.model) {
|
||||
conversation.model = OpenAIModels[OpenAIModelID.GPT_3_5];
|
||||
|
||||
Reference in New Issue
Block a user