feat: 支持上下文深度配置,计算每轮对话消耗的总 token 数量

This commit is contained in:
RockYang
2023-07-15 18:37:25 +08:00
parent cc1b56501d
commit d014d418e9
3 changed files with 50 additions and 13 deletions

View File

@@ -65,6 +65,14 @@
<el-switch v-model="chat['enable_history']"/>
</el-form-item>
<el-alert type="info" show-icon :closable="false">
<p>会话上下文深度在老会话中继续会话默认加载多少条聊天记录作为上下文如果设置为 0
则不加载聊天记录仅仅使用当前角色的上下文该配置参数最好设置为 2 的整数倍</p>
</el-alert>
<el-form-item label="会话上下文深度">
<el-input-number v-model="chat['context_deep']" :min="0" :max="10"/>
</el-form-item>
<el-form-item style="text-align: right">
<el-button type="primary" @click="save('chat')">保存</el-button>
</el-form-item>
@@ -178,6 +186,10 @@ const addModel = function () {
font-size 16px;
}
}
.tip-text {
padding-left 10px;
}
}
}