feat(agent): add debug output switches

This commit is contained in:
2026-07-17 14:19:23 +08:00
parent a879dc2ff1
commit c7bafda135
5 changed files with 60 additions and 4 deletions

View File

@@ -49,6 +49,8 @@ const agentForm = reactive({
presencePenalty: null as number | null,
frequencyPenalty: null as number | null,
maxToken: 8192 as number | null,
streamEnabled: 1,
reasoningVisible: 0,
question: "",
});
const runtimeConfig = ref<AgentRuntimeConfig | null>(null);
@@ -130,6 +132,8 @@ function applyDebugModelDefaults(modelId?: number) {
presencePenalty: model.presencePenalty ?? null,
frequencyPenalty: model.frequencyPenalty ?? null,
maxToken: model.maxToken ?? (model.enabled === 1 ? runtimeConfig.value?.maxToken : null) ?? 8192,
streamEnabled: model.streamEnabled ?? 1,
reasoningVisible: runtimeConfig.value?.reasoningVisible ?? 0,
});
}
@@ -293,6 +297,8 @@ async function debugAgent() {
presencePenalty: agentForm.presencePenalty,
frequencyPenalty: agentForm.frequencyPenalty,
maxToken: agentForm.maxToken,
streamEnabled: agentForm.streamEnabled,
reasoningVisible: agentForm.reasoningVisible,
},
(chunk) => {
currentAssistant().content += chunk;
@@ -469,6 +475,34 @@ function errorMessage(error: unknown, fallback: string) {
v-model:frequency-penalty="agentForm.frequencyPenalty"
v-model:max-token="agentForm.maxToken"
/>
<el-form-item class="agent-stream-setting">
<div class="agent-stream-setting-copy">
<strong>流式输出</strong>
<span>开启后后台预览会边生成边展示关闭后等待模型完成再一次性显示</span>
</div>
<el-switch
v-model="agentForm.streamEnabled"
:active-value="1"
:inactive-value="0"
active-text="开启"
inactive-text="关闭"
inline-prompt
/>
</el-form-item>
<el-form-item class="agent-stream-setting">
<div class="agent-stream-setting-copy">
<strong>展示思考过程</strong>
<span>开启后本次后台预览可展开查看模型思考内容不会修改用户端正式配置</span>
</div>
<el-switch
v-model="agentForm.reasoningVisible"
:active-value="1"
:inactive-value="0"
active-text="开启"
inactive-text="关闭"
inline-prompt
/>
</el-form-item>
</section>
</el-form>
</el-tab-pane>