Skip to content

WebUI: Reduce adjustment granularity of Temperature and Top-p controls - #11176

Closed
Sha1rholder wants to merge 1 commit into
AstrBotDevs:masterfrom
Sha1rholder:reduce-granularity-of-some-controls
Closed

Sha1rholder wants to merge 1 commit into
AstrBotDevs:masterfrom
Sha1rholder:reduce-granularity-of-some-controls

Conversation

@Sha1rholder

@Sha1rholder Sha1rholder commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Modifications / 改动点

WebUI: Reduce adjustment granularity of temperature and top-k controls from 1 to 0.05 in “Providers”.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

before.webm
after.webm

Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。

  • 📚 I checked the affected WebUI instructions and screenshots in docs/zh and docs/en against the changed navigation, page structure, and labels, and updated them in this PR (or explained why no documentation update is needed). For renamed, moved, or merged entry points, I included an old entry → new entry mapping in the documentation and changelog.
    / 我已对照变化后的 WebUI 入口、页面结构和术语,核对并在本 PR 中更新 docs/zh 和 docs/en 的相关操作说明与截图(或说明无需更新文档的原因)。入口改名、移动或合并时,已在文档和 changelog 中补充 旧入口 → 新入口 对照。

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txt 和 pyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Enhancements:

  • Allow Temperature and Top-p controls in provider custom extra-body settings to be adjusted in 0.05 increments.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="dashboard/src/components/shared/ObjectEditor.vue" line_range="169" />
<code_context>
                     :model-value="getTemplateValue(templateKey)"
                     @update:model-value="updateTemplateValue(templateKey, $event)"
                     type="number"
+                    :step="!pluginName && configKey.split('.').pop() === 'custom_extra_body' && ['temperature', 'top_p'].includes(templateKey) ? 0.05 : 1"
                     density="compact"
                     variant="outlined"
</code_context>
<issue_to_address>
**Slider increments ignore finer field steps**

When a user adjusts temperature or top-p with a template slider, the template sliders use `template.slider.step`, so temperature changes by 0.1 and top-p by 0.01 instead of matching the number field’s 0.05 step; users get different increments depending on the control.

Use the same 0.05 step for the corresponding template sliders and number fields.
</issue_to_address>

### Comment 2
<location path="dashboard/src/components/shared/ObjectEditor.vue" line_range="169" />
<code_context>
                     :model-value="getTemplateValue(templateKey)"
                     @update:model-value="updateTemplateValue(templateKey, $event)"
                     type="number"
+                    :step="!pluginName && configKey.split('.').pop() === 'custom_extra_body' && ['temperature', 'top_p'].includes(templateKey) ? 0.05 : 1"
                     density="compact"
                     variant="outlined"
</code_context>
<issue_to_address>
**Top-k fields keep whole-number steps**

When a provider’s `custom_extra_body` contains a numeric `top_k` parameter, the step condition excludes `top_k`, so its number field keeps the default increment of 1 instead of allowing 0.05 increments.

Include `top_k` in the condition that sets the number-field step to 0.05.
</issue_to_address>

### Comment 3
<location path="dashboard/src/components/shared/ObjectEditor.vue" line_range="76-78" />
<code_context>
                   </template>
-                  
+
                   <v-text-field
                     v-model.number="pair.value"
                     type="number"
</code_context>
<issue_to_address>
**Unrelated numeric inputs are added**

When the object contains a non-template numeric key, `ObjectEditor` adds a number input to non-template numeric keys in the general object editor, expanding editing behavior beyond the provider temperature and top-p controls. Users see new inputs for unrelated dictionary settings.

Remove the generic number-input addition or limit it to a demonstrated need for the provider controls.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: dashboard/src/components/shared/ObjectEditor.vue:169, dashboard/src/components/shared/ObjectEditor.vue:169


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@Sha1rholder Sha1rholder changed the title WebUI: Reduce adjustment granularity of temperature and top-k controls WebUI: Reduce adjustment granularity of Temperature and Top-p controls Nov 16, 2026
@Sha1rholder
Sha1rholder force-pushed the reduce-granularity-of-some-controls branch from 0ef80ad to 6a26373 Compare November 16, 2026 09:18
@Sha1rholder

Copy link
Copy Markdown
Contributor Author

如果合并了 #11187 的话这个PR就不需要了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant