fix: 支持模型异常后继续文档对话
- 将本轮文档上下文纳入可持久化的 Agent 用户消息 =- 在异常提示中提供请重试动作并自动发送继续
This commit is contained in:
@@ -1,13 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
actionDisabled?: boolean;
|
||||
actionLabel?: string;
|
||||
message: string;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
action: [];
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="chat-error-notice" role="alert">
|
||||
<span class="chat-error-notice__icon" aria-hidden="true">!</span>
|
||||
<span>{{ message }}</span>
|
||||
<span class="chat-error-notice__content">
|
||||
<span>{{ message }}<template v-if="actionLabel">,</template></span>
|
||||
<button
|
||||
v-if="actionLabel"
|
||||
type="button"
|
||||
class="chat-error-notice__action"
|
||||
:disabled="actionDisabled"
|
||||
@click="emit('action')"
|
||||
>
|
||||
{{ actionLabel }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -39,4 +56,41 @@ defineProps<{
|
||||
border: 1px solid currentColor;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.chat-error-notice__content {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.chat-error-notice__action {
|
||||
padding: 0;
|
||||
margin-left: var(--space-1);
|
||||
font: inherit;
|
||||
font-weight: 600;
|
||||
line-height: inherit;
|
||||
color: currentcolor;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: var(--el-border-radius-small);
|
||||
}
|
||||
|
||||
.chat-error-notice__action:hover:not(:disabled) {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.chat-error-notice__action:active:not(:disabled) {
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.chat-error-notice__action:focus-visible {
|
||||
outline: 2px solid var(--el-color-primary-light-3);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.chat-error-notice__action:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user