feat(agent): add debug output switches
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user