update experience for chat

This commit is contained in:
AceDataCloud committed 2023-10-03 20:13:23 +08:00
1 parent 7ca606ae20
commit 71dec1cb67
8 files changed
+151 -42

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
<template>
<div class="box"></div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
name: 'AnwseringMark',
data() {
return {};
},
computed: {
conversationId() {
return this.$route.params?.id?.toString();
}
}
});
</script>
<style lang="scss">
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.box {
width: 2px;
height: 16px;
margin-top: 3px;
background-color: var(--el-color-black);
animation: blink 1s infinite;
}
</style>
+7 -4
View File
@@ -2,23 +2,25 @@
<div :class="'message ' + message.role">
<div class="content">
<markdown-renderer :content="message?.content" />
<answering-mark v-if="message.state === messageState.PENDING" />
</div>
</div>
</template>
<script lang="ts">
import { IContent, IError, IMessage, IMessageState } from '@/operators/message/models';
import { IContent, IError, IMessage } from '@/operators/message/models';
import { defineComponent } from 'vue';
import AnsweringMark from './AnsweringMark.vue';
// import MessageContent from './MessageContent.vue';
import { ElImage, ElButton } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import copy from 'copy-to-clipboard';
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
import { IChatMessage } from '@/operators';
import { IChatMessage, IChatMessageState } from '@/operators';
interface IData {
copied: boolean;
messageState: typeof IMessageState;
messageState: typeof IChatMessageState;
}
export default defineComponent({
@@ -28,6 +30,7 @@ export default defineComponent({
// ElImage,
// ElButton,
// FontAwesomeIcon
AnsweringMark,
MarkdownRenderer
},
props: {
@@ -40,7 +43,7 @@ export default defineComponent({
data(): IData {
return {
copied: false,
messageState: IMessageState
messageState: IChatMessageState
};
},
computed: {
+2 -2
View File
@@ -92,14 +92,14 @@ export default defineComponent({
const options = group.options;
if (options && options.length > 0) {
this.value = options[0];
this.$emit('select', options[0]);
this.$emit('update:modelValue', options[0]);
this.$emit('select', options[0]);
}
},
onCommandChange(command: IChatModel) {
this.value = command;
this.$emit('select', command);
this.$emit('update:modelValue', command);
this.$emit('select', command);
}
}
});
+3 -10
View File
@@ -1,5 +1,5 @@
<template>
<span v-if="application && !initializing" class="info">
<span v-if="application" class="info">
{{ $t('conversation.message.usedCount') }}: {{ application?.used_amount }}
{{ $t('conversation.message.remainingCount') }}: {{ application?.remaining_amount }}
</span>
@@ -8,21 +8,14 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { IApplication } from '@/operators';
import { ElSkeleton } from 'element-plus';
export default defineComponent({
name: 'ApiStatus',
components: {
ElSkeleton
},
components: {},
props: {
application: {
type: Object as () => IApplication,
required: true
},
initializing: {
type: Boolean,
required: true
}
},
data() {
@@ -36,6 +29,6 @@ export default defineComponent({
<style lang="scss">
.info {
font-size: 14px;
color: var(--el-color-black);
color: var(--el-text-color-regular);
}
</style>
@@ -6,7 +6,7 @@
import { defineComponent } from 'vue';
export default defineComponent({
name: 'MessageContent',
name: 'AnwseringMark',
data() {
return {};
},