feat: 支持智能体文档附件与轻量读取
- 建立文档上传、异步读取、对象存储、补偿与聊天绑定闭环 - 按智能体 20K 上下文预算选择文档片段并保留稳定引用 - 统一聊天文件卡片、类型图标、草稿恢复与可靠下载
This commit is contained in:
@@ -97,6 +97,44 @@ const emit = defineEmits<{ change: [] }>();
|
||||
@change="emit('change')"
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem>
|
||||
<template #label>
|
||||
<span class="agent-form__label">
|
||||
文档上下文预算
|
||||
<ElTooltip
|
||||
:trigger-keys="['Enter', 'Space']"
|
||||
content="控制单次对话最多注入多少文档内容,建议设置为 20K Token 或以上。数值过低可能导致长文档仅读取部分内容,影响回答完整性;请确保该值未超过模型的实际上下文能力。"
|
||||
effect="light"
|
||||
placement="top"
|
||||
>
|
||||
<ElIcon
|
||||
class="agent-form__info"
|
||||
aria-label="文档上下文预算说明"
|
||||
tabindex="0"
|
||||
>
|
||||
<InfoFilled />
|
||||
</ElIcon>
|
||||
</ElTooltip>
|
||||
</span>
|
||||
</template>
|
||||
<ElInputNumber
|
||||
v-model="agent.executionConfigJson!.documentContextBudgetTokens"
|
||||
:min="1"
|
||||
:step="1000"
|
||||
controls-position="right"
|
||||
aria-label="文档上下文预算 Token 数"
|
||||
@change="emit('change')"
|
||||
/>
|
||||
<div
|
||||
v-if="
|
||||
Number(agent.executionConfigJson!.documentContextBudgetTokens) <
|
||||
20_000
|
||||
"
|
||||
class="agent-form__hint is-warning"
|
||||
>
|
||||
建议设置为 20K Token 或以上
|
||||
</div>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="系统提示词">
|
||||
<ElInput
|
||||
v-model="agent.promptConfigJson!.systemPrompt"
|
||||
@@ -175,14 +213,24 @@ const emit = defineEmits<{ change: [] }>();
|
||||
|
||||
.agent-form__label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.agent-form__info {
|
||||
font-size: 14px;
|
||||
color: var(--el-text-color-secondary);
|
||||
cursor: help;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.agent-form__hint {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.agent-form__hint.is-warning {
|
||||
color: var(--el-color-warning);
|
||||
}
|
||||
|
||||
.agent-form :deep(.el-select),
|
||||
|
||||
Reference in New Issue
Block a user