mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 16:04:01 +00:00
feat: expose configurable reasoning effort
This commit is contained in:
1 parent
e5f4e3a583
commit
683b7e9af0
10 files changed
+684
-36
No files matched your search
@@ -128,6 +128,9 @@ function fillConfig(value) {
|
||||
$("#c-timeout").value = value.retry.timeout_seconds;
|
||||
$("#c-refresh").value = value.models.refresh_seconds;
|
||||
$("#c-protocols").value = JSON.stringify(value.models.protocols || {}, null, 2);
|
||||
const reasoning = value.reasoning || {};
|
||||
$("#c-reasoning-effort").value = reasoning.effort || "";
|
||||
$("#c-reasoning-by-model").value = JSON.stringify(reasoning.effort_by_model || {}, null, 2);
|
||||
$("#c-idle").value = value.performance.max_idle_conns;
|
||||
$("#c-idle-host").value = value.performance.max_idle_conns_per_host;
|
||||
$("#c-max-host").value = value.performance.max_conns_per_host;
|
||||
@@ -191,6 +194,10 @@ $("#config-form").addEventListener("submit", async (event) => {
|
||||
refresh_seconds: number("#c-refresh"),
|
||||
protocols: JSON.parse($("#c-protocols").value || "{}"),
|
||||
},
|
||||
reasoning: {
|
||||
effort: $("#c-reasoning-effort").value,
|
||||
effort_by_model: JSON.parse($("#c-reasoning-by-model").value || "{}"),
|
||||
},
|
||||
performance: {
|
||||
max_idle_conns: number("#c-idle"),
|
||||
max_idle_conns_per_host: number("#c-idle-host"),
|
||||
|
||||
@@ -545,6 +545,42 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section-head">
|
||||
<div>
|
||||
<h2>Thinking 强度</h2>
|
||||
<div class="section-caption">
|
||||
仅在客户端没有明确指定时生效;按模型覆盖默认值。选择“关闭”会移除未明确请求的 reasoning。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-grid">
|
||||
<div class="field">
|
||||
<label>默认强度</label
|
||||
><select id="c-reasoning-effort">
|
||||
<option value="">跟随客户端</option>
|
||||
<option value="minimal">minimal</option>
|
||||
<option value="low">low</option>
|
||||
<option value="medium">medium</option>
|
||||
<option value="high">high</option>
|
||||
<option value="xhigh">xhigh</option>
|
||||
<option value="max">max</option>
|
||||
<option value="none">关闭</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field full">
|
||||
<label>按模型覆盖(JSON)</label
|
||||
><textarea
|
||||
id="c-reasoning-by-model"
|
||||
spellcheck="false"
|
||||
placeholder='{"model-id":"high"}'
|
||||
></textarea>
|
||||
<div class="section-caption">
|
||||
值可为 minimal、low、medium、high、xhigh、max 或 none;空对象表示不覆盖。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section-head">
|
||||
<div>
|
||||
|
||||
Reference in new issue
Block a user