Skip to content

Commit

Permalink
feat: Remove chat tags
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Aug 6, 2024
1 parent 37b589e commit dd3de86
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/migrations/chats/chat_5_remove_tags.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Chat, ChatMigration } from 'src/types/chats';

export const chat_5_remove_tags: ChatMigration = (currentChat: Chat) => {
const newChat = { ...currentChat };

// @ts-expect-error
delete newChat.tags;

return newChat;
};
2 changes: 2 additions & 0 deletions src/migrations/chats/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { chat_1_add_message_author } from 'src/migrations/chats/chat_1_add_messa
import { chat_2_add_persona_role_and_ipfs_avatar } from 'src/migrations/chats/chat_2_add_persona_role_and_ipfs_avatar';
import { chat_3_add_model_id } from 'src/migrations/chats/chat_3_add_model_id';
import { chat_4_add_knowledge_bases } from 'src/migrations/chats/chat_4_add_knowledge_bases';
import { chat_5_remove_tags } from 'src/migrations/chats/chat_5_remove_tags';

export const chatsMigrations: ChatMigration[] = [
chat_1_add_message_author,
chat_2_add_persona_role_and_ipfs_avatar,
chat_3_add_model_id,
chat_4_add_knowledge_bases,
chat_5_remove_tags,
];
1 change: 0 additions & 1 deletion src/pages/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ async function generatePersonaMessage() {
}
const chatId = chatRef.value.id;
// const chatTags = chatRef.value.tags;
const username = chatRef.value.username;
const messages = JSON.parse(JSON.stringify(chatRef.value.messages));
const persona = chatRef.value.persona;
Expand Down
2 changes: 0 additions & 2 deletions src/stores/chats.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { v4 as uuidv4 } from 'uuid';
import { defineStore } from 'pinia';
import { chatTag } from 'src/utils/chat';
import { chatsMigrations } from 'src/migrations/chats';
import { Chat, MessageAttachment, UIMessage } from 'src/types/chats';
import { UIPersona } from 'src/types/personas';
Expand Down Expand Up @@ -84,7 +83,6 @@ export const useChatsStore = defineStore(CHATS_STORE_PINIA_KEY, {
const chat: Chat = {
id,
title,
tags: [chatTag(id)],
username,
modelId,
persona,
Expand Down
1 change: 0 additions & 1 deletion src/types/chats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export type Chat = {
id: string;
title: string;
username: string;
tags: string[];

modelId?: string;
persona: UIPersona;
Expand Down

0 comments on commit dd3de86

Please sign in to comment.