From 3075ba9064d1ab07a7e62327083464c44bdad27b Mon Sep 17 00:00:00 2001 From: 622aa39c1f9b166ab1a38c05 <622aa39c1f9b166ab1a38c05@devide> Date: Mon, 3 Jul 2023 09:01:00 +0000 Subject: [PATCH] Mon Jul 3 09:01:00 UTC 2023 inscode --- package.json | 4 +++- src/App.vue | 10 +++++----- src/js/config.js | 14 +++++++++++++- src/main.js | 8 ++++++-- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 54ade2f..0da4bda 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "preview": "vite preview --port 4173" }, "dependencies": { - "fetch-event-source": "^1.0.0-alpha.2", + "@microsoft/fetch-event-source": "^2.0.1", "guess": "^1.0.2", + "npm": "^9.7.2", + "tdesign-vue-next": "^1.3.9", "vue": "^3.2.37" }, "devDependencies": { diff --git a/src/App.vue b/src/App.vue index 8617273..46b7bc9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -103,7 +103,7 @@ import Config from './js/config.js' // import 'markdown-it-vue/dist/markdown-it-vue.css' // https://github.com/ravenq/markdown-it-vue -const DataServe = new Data() +// const DataServe = new Data() export default { name: 'LlmApp', @@ -273,11 +273,12 @@ export default { getAppInfo() { - const data = Config.getData() + const data = Config.getData().data this.name = data.name document.title = this.name if (data.ext) { - const config = JSON.parse(data.ext) + const config = data.ext + debugger this.config = config if (config.default_prompt) { this.prompt = config.default_prompt @@ -295,7 +296,6 @@ export default { this.showProfileSetting = config?.show_profile_setting??false this.initAIClient() - this.initIndexClient() console.info(config) } }, @@ -356,7 +356,7 @@ export default { this.id = this.$route?.params?.id this.recoveryHistory() this.getAppInfo() - this.getAvatar() + // this.getAvatar() } }; diff --git a/src/js/config.js b/src/js/config.js index cdd5a36..6a88e12 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -8,7 +8,19 @@ export default { "create_time": 1684920670901, "app": "llm_rep", "resource_type": "app", - "ext": "{\"mode\": \"chat\", \"model\": \"chatglm2-6b\", \"api_url\": \"https://gpu-pod647d498393e106496a046e94-8000.node.inscode.run/v1\", \"api_type\": \"openai\", \"robot_img\": null, \"api_max_token\": \"2048\", \"default_prompt\": \"请翻译成英文:你是谁?\", \"max_request_len\": \"10000\", \"prompt_template\": \"\", \"api_prompt_prefix\": \"\", \"show_profile_setting\": false}" + "ext": { + "mode":"chat", + "model":"vicuna-7b-all-v1.1", + "api_url":"https://gpu-pod647d498393e106496a046e94-8000.node.inscode.run/v1", + "api_type":"openai", + "robot_img":null, + "api_max_token":"2048", + "default_prompt":"请翻译成英文:你是谁?", + "max_request_len":"10000", + "prompt_template":"", + "api_prompt_prefix":"", + "show_profile_setting":false + } }, "message": "success" } diff --git a/src/main.js b/src/main.js index c84568c..d8fe56b 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,11 @@ import { createApp } from 'vue' +import TDesign from 'tdesign-vue-next'; + import App from './App.vue' +import 'tdesign-vue-next/es/style/index.css'; -import './assets/main.css' import './style.css' -createApp(App).mount('#app') +const app = createApp(App); +app.use(TDesign); +app.mount('#app') \ No newline at end of file -- GitLab