diff --git a/src/assets/images/leaflow.png b/src/assets/images/leaflow.png index 7025f5f..78a5233 100644 Binary files a/src/assets/images/leaflow.png and b/src/assets/images/leaflow.png differ diff --git a/src/components.d.ts b/src/components.d.ts index f47bdb4..576b602 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -9,6 +9,7 @@ declare module 'vue' { export interface GlobalComponents { AssistantMenu: typeof import('./components/AssistantMenu.vue')['default'] Assistants: typeof import('./components/assistants/index.vue')['default'] + AssistantSettings: typeof import('./components/AssistantSettings.vue')['default'] Chat: typeof import('./components/chat/Chat.vue')['default'] ChatMenu: typeof import('./components/ChatMenu.vue')['default'] ChatSettings: typeof import('./components/ChatSettings.vue')['default'] diff --git a/src/components/AssistantSettings.vue b/src/components/AssistantSettings.vue new file mode 100644 index 0000000..62a57cf --- /dev/null +++ b/src/components/AssistantSettings.vue @@ -0,0 +1,144 @@ + + + + + + + {{ c.name }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 更新 + + + + + + + + diff --git a/src/components/LeftSettings.vue b/src/components/LeftSettings.vue index 68bae3b..197fb49 100644 --- a/src/components/LeftSettings.vue +++ b/src/components/LeftSettings.vue @@ -4,7 +4,7 @@ - + “威尔!着火了!快来帮忙!”我听到女朋友大喊。现在一个难题在我面前——是恢复一个重要的 diff --git a/src/components/assistants/index.vue b/src/components/assistants/index.vue deleted file mode 100644 index 71ee698..0000000 --- a/src/components/assistants/index.vue +++ /dev/null @@ -1,6 +0,0 @@ - - 助理 - - - \ No newline at end of file diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index 8c5095b..0a90060 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -56,7 +56,10 @@ ref="actionContainer" class="flex [&>button]:ml-2 pr-4 justify-end" > - + @@ -134,7 +137,11 @@ import { DocumentAttachOutline, TrashBinOutline, } from "@vicons/ionicons5"; -import { EntityChatMessage, SchemaChatMessageAddRequestRoleEnum } from "@/api"; +import { + EntityChatMessage, + SchemaChatMessageAddRequestRoleEnum, + EntityChat, +} from "@/api"; import getApi from "@/plugins/api"; import MessageList from "./MessageList.vue"; import { useChatStore } from "@/stores/chat"; @@ -179,7 +186,6 @@ const uploading = ref(false); const autoScroll = ref(true); const onBottom = ref(false); - function onKeydown(e: KeyboardEvent) { // 带 shift 不触发 if (e.shiftKey || inputExpanded.value) { @@ -519,11 +525,22 @@ const clearChatHistory = async () => { processing.value = false; }; +const chatData: Ref = ref({}); +const getChat = async () => { + chatData.value = ( + await getApi().Chat.apiV1ChatsIdGet(chatStore.currentChatId) + ).data.data; +}; + onMounted(() => { chatId.value = props.chatId; chatStore.currentChatId = Number(chatId.value); updateInputHeight(); getChatMessages(); + + if (chatId.value) { + getChat(); + } }); onUnmounted(() => { diff --git a/src/plugins/api.ts b/src/plugins/api.ts index 3faee26..da06e73 100644 --- a/src/plugins/api.ts +++ b/src/plugins/api.ts @@ -4,6 +4,7 @@ import { ChatMessageApi, ChatPublicApi, Configuration, + LibrariesApi, PingApi, ToolApi, } from "../api"; @@ -20,6 +21,7 @@ interface Api { Tool: ToolApi; ChatMessage: ChatMessageApi; ChatPublic: ChatPublicApi; + Library: LibrariesApi; conf: Configuration } @@ -50,6 +52,7 @@ const getApi = () => { Tool: new ToolApi(conf, undefined, axios), ChatMessage: new ChatMessageApi(conf, undefined, axios), ChatPublic: new ChatPublicApi(conf, undefined, axios), + Library: new LibrariesApi(conf, undefined, axios), conf: conf };