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);
}
}
});