diff --git a/package.json b/package.json
index 18a115daabd7c5429ec74c07226a79595e3392f8..83da512e7fb678dbb66f485d3ed877d0b96aecfb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
- "name": "vuejs-with-vite",
- "version": "0.0.0",
+ "name": "ai-rag",
+ "version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
@@ -11,13 +11,15 @@
"axios": "^1.4.0",
"fs": "^0.0.1-security",
"guess": "^1.0.2",
- "markdown-it-vue": "^1.1.7",
+ "highlight.js": "^11.9.0",
+ "marked": "^11.1.1",
"npm": "^9.7.2",
"tdesign-vue-next": "^1.3.9",
"vue": "^3.2.37"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.3",
+ "@tailwindcss/typography": "^0.5.10",
"@vitejs/plugin-vue": "^3.0.1",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.33",
diff --git a/src/App.vue b/src/App.vue
index 53bb1756f646357e5388c1f667d4d9f1620d7016..27d926755e5f079a59f5f6d82118429513d155ab 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -34,7 +34,7 @@
-
+
@@ -51,15 +51,13 @@
-
+
-
- {{ item.message }}
-
+
@@ -84,7 +82,10 @@
-
+
@@ -136,27 +137,21 @@ import OpenAI from './js/openai.js'
import Config from './js/config.js'
import InsCodeAI from './js/inscodeai.js'
-import SDApi from './js/sd.js'
+// import SDApi from './js/sd.js'
import StorageApi from './js/storage.js'
-import PodsApi from './js/pod.js'
+// import PodsApi from './js/pod.js'
import RepEs from './js/repEs.js'
import { MessagePlugin } from 'tdesign-vue-next';
import Content from './components/content/index.vue'
-// import MarkdownItVue from 'markdown-it-vue'
-// import 'markdown-it-vue/dist/markdown-it-vue.css'
-// https://github.com/ravenq/markdown-it-vue
-import MarkdownItVue from 'markdown-it-vue'
-import 'markdown-it-vue/dist/markdown-it-vue.css'
-
-// const DataServe = new Data()
+import markdownPreview from './components/markdown-preview/index.vue'
export default {
- name: 'LlmApp',
+ name: 'AIRag',
components: {
- MarkdownItVue, Content
+ markdownPreview, Content
},
data() {
return {
@@ -302,7 +297,10 @@ export default {
this.prompt = ''
messages.push({ "user": "User", "message": newPrompt })
messages.push(currentMsg)
- _this.$refs.messageList.scrollTop = _this.$refs.messageList.scrollHeight;
+ if (_this.$refs.messageList.scrollHeight) {
+ _this.$refs.messageList.scrollTop = _this.$refs.messageList.scrollHeight;
+
+ }
if (this.indexClient) {
this.indexClient.query(newPrompt).then(res => {
diff --git a/src/components/content/index.vue b/src/components/content/index.vue
index 7ecd729abf20c189e90d15c761eaa6f5fd31b78b..09d8c20af825bdca618bcacbf65a3dac3c2ae6b8 100644
--- a/src/components/content/index.vue
+++ b/src/components/content/index.vue
@@ -4,9 +4,9 @@
-
-
-
+
+
+