mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-30 21:00:30 +08:00
feat(hermes): add model token limits config
This commit is contained in:
@@ -88,6 +88,8 @@ const MODEL_DEFAULTS = {
|
||||
modelDefault: '',
|
||||
modelProvider: 'auto',
|
||||
modelBaseUrl: '',
|
||||
modelContextLength: '',
|
||||
modelMaxTokens: '',
|
||||
}
|
||||
|
||||
const MODEL_ALIASES_DEFAULTS = {
|
||||
@@ -962,6 +964,14 @@ export function render() {
|
||||
<span class="hm-field-label">${t('engine.hermesModelConfigBaseUrl')}</span>
|
||||
<input id="hm-model-base-url" class="hm-input" value="${esc(modelValues.modelBaseUrl)}" placeholder="https://openrouter.ai/api/v1" ${disabled ? 'disabled' : ''}>
|
||||
</label>
|
||||
<label class="hm-field">
|
||||
<span class="hm-field-label">${t('engine.hermesModelConfigContextLength')}</span>
|
||||
<input id="hm-model-context-length" class="hm-input" type="number" inputmode="numeric" min="1" max="10000000" step="1" value="${esc(modelValues.modelContextLength)}" placeholder="131072" ${disabled ? 'disabled' : ''}>
|
||||
</label>
|
||||
<label class="hm-field">
|
||||
<span class="hm-field-label">${t('engine.hermesModelConfigMaxTokens')}</span>
|
||||
<input id="hm-model-max-tokens" class="hm-input" type="number" inputmode="numeric" min="1" max="10000000" step="1" value="${esc(modelValues.modelMaxTokens)}" placeholder="8192" ${disabled ? 'disabled' : ''}>
|
||||
</label>
|
||||
</div>
|
||||
<div class="hm-channel-footnote">${t('engine.hermesModelConfigFootnote')}</div>
|
||||
</div>
|
||||
@@ -3018,6 +3028,8 @@ export function render() {
|
||||
modelDefault: el.querySelector('#hm-model-default')?.value || '',
|
||||
modelProvider: el.querySelector('#hm-model-provider')?.value || 'auto',
|
||||
modelBaseUrl: el.querySelector('#hm-model-base-url')?.value || '',
|
||||
modelContextLength: el.querySelector('#hm-model-context-length')?.value || '',
|
||||
modelMaxTokens: el.querySelector('#hm-model-max-tokens')?.value || '',
|
||||
}
|
||||
modelSaving = true
|
||||
modelError = null
|
||||
|
||||
@@ -834,7 +834,9 @@ export default {
|
||||
hermesModelConfigDefault: _('默认模型', 'Default model', '預設模型'),
|
||||
hermesModelConfigProvider: _('Provider', 'Provider', 'Provider'),
|
||||
hermesModelConfigBaseUrl: _('兼容接口地址(可选)', 'Compatible API base URL (optional)', '相容介面位址(可選)'),
|
||||
hermesModelConfigFootnote: _('默认模型不能为空;provider 为空时建议填 auto。兼容接口地址留空会移除 model.base_url,并保留 model 下其它高级字段。', 'Default model is required; use auto when no provider is pinned. Leaving the base URL blank removes model.base_url while preserving other advanced model fields.', '預設模型不可為空;未固定 provider 時建議填 auto。相容介面位址留空會移除 model.base_url,並保留 model 下其他進階欄位。'),
|
||||
hermesModelConfigContextLength: _('上下文窗口(可选)', 'Context window (optional)', '上下文視窗(可選)'),
|
||||
hermesModelConfigMaxTokens: _('单次输出上限(可选)', 'Output token cap (optional)', '單次輸出上限(可選)'),
|
||||
hermesModelConfigFootnote: _('上下文窗口是输入和输出合计容量,单次输出上限只限制回复长度;两项留空会移除对应字段,由 Hermes 自动检测或使用模型默认值。', 'Context window is the total input plus output capacity. Output token cap only limits reply length. Leave either blank to remove that field so Hermes auto-detects or uses the model default.', '上下文視窗是輸入與輸出合計容量,單次輸出上限只限制回覆長度;兩項留空會移除對應欄位,由 Hermes 自動偵測或使用模型預設值。'),
|
||||
hermesModelAliasesConfigTitle: _('模型别名', 'Model aliases', '模型別名'),
|
||||
hermesModelAliasesConfigDesc: _('配置 /model 命令可用的短别名,把常用模型、provider 和自定义 base_url 固定下来,减少手输错误。', 'Configure short aliases for the /model command, pinning common models, providers, and custom base_url values to reduce manual input errors.', '設定 /model 命令可用的短別名,把常用模型、provider 和自訂 base_url 固定下來,減少手動輸入錯誤。'),
|
||||
hermesModelAliasesConfigStatusReady: _('结构化 JSON', 'structured JSON', '結構化 JSON'),
|
||||
|
||||
Reference in New Issue
Block a user