fix: 支持模型异常后继续文档对话
- 将本轮文档上下文纳入可持久化的 Agent 用户消息 =- 在异常提示中提供请重试动作并自动发送继续
This commit is contained in:
@@ -3,6 +3,7 @@ import type {
|
||||
ChatArtifactLoader,
|
||||
ChatDocumentLoader,
|
||||
ChatImageLoader,
|
||||
ChatTimelineErrorItem,
|
||||
ChatTimelineItem,
|
||||
ChatTimelineMessageItem,
|
||||
ChatTimelineMessagePart,
|
||||
@@ -31,6 +32,8 @@ const props = defineProps<{
|
||||
copyable?: boolean;
|
||||
copyAction?: (item: ChatTimelineMessageItem) => boolean | Promise<boolean>;
|
||||
documentLoader?: ChatDocumentLoader;
|
||||
errorActionDisabled?: boolean;
|
||||
errorActionLabel?: string;
|
||||
imageLoader?: ChatImageLoader;
|
||||
item: ChatTimelineItem;
|
||||
regenerable?: boolean;
|
||||
@@ -41,6 +44,7 @@ const props = defineProps<{
|
||||
const emit = defineEmits<{
|
||||
approve: [payload: ChatTimelineToolApprovalPayload];
|
||||
copyMessage: [item: ChatTimelineMessageItem];
|
||||
errorAction: [item: ChatTimelineErrorItem];
|
||||
regenerateMessage: [item: ChatTimelineMessageItem];
|
||||
reject: [payload: ChatTimelineToolApprovalPayload];
|
||||
selectNextVariant: [item: ChatTimelineMessageItem];
|
||||
@@ -280,7 +284,10 @@ function handleCopyAction() {
|
||||
</div>
|
||||
<ChatErrorNotice
|
||||
v-else-if="item.type === 'error'"
|
||||
:action-disabled="errorActionDisabled"
|
||||
:action-label="errorActionLabel"
|
||||
:message="item.message"
|
||||
@action="emit('errorAction', item)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user