opt: optimize the styles of chat page; caculate all tokens of context as chat history's token

This commit is contained in:
RockYang
2023-09-11 13:34:20 +08:00
parent f4349c7a8c
commit 327929243c
14 changed files with 95 additions and 60 deletions

View File

@@ -140,8 +140,8 @@ const send = (url, index) => {
margin-right 20px;
img {
width: 30px;
height: 30px;
width: 36px;
height: 36px;
border-radius: 10px;
padding: 1px;
}

View File

@@ -19,9 +19,8 @@
<script>
import {defineComponent} from "vue"
import {dateFormat} from "@/utils/libs";
import {Clock} from "@element-plus/icons-vue";
import {httpGet} from "@/utils/http";
import {httpPost} from "@/utils/http";
export default defineComponent({
name: 'ChatPrompt',
@@ -56,7 +55,7 @@ export default defineComponent({
},
mounted() {
if (!this.finalTokens) {
httpGet(`/api/chat/tokens?text=${this.content}&model=${this.model}`).then(res => {
httpPost("/api/chat/tokens", {text: this.content, model: this.model}).then(res => {
this.finalTokens = res.data;
})
}
@@ -83,8 +82,8 @@ export default defineComponent({
margin-right 20px;
img {
width: 30px;
height: 30px;
width: 36px;
height: 36px;
border-radius: 10px;
padding: 1px;
}

View File

@@ -86,8 +86,8 @@ export default defineComponent({
margin-right 20px;
img {
width: 30px;
height: 30px;
width: 36px;
height: 36px;
border-radius: 10px;
padding: 1px;
}