feat: make 5m cache-creation ratio configurable

This commit is contained in:
Seefs
2026-02-06 19:46:59 +08:00
parent cb34e23918
commit 8ef6089bf7
13 changed files with 99 additions and 5 deletions

View File

@@ -43,6 +43,7 @@ export default function ModelRatioSettings(props) {
ModelPrice: '',
ModelRatio: '',
CacheRatio: '',
CreateCacheRatio: '',
CompletionRatio: '',
ImageRatio: '',
AudioRatio: '',
@@ -200,6 +201,30 @@ export default function ModelRatioSettings(props) {
/>
</Col>
</Row>
<Row gutter={16}>
<Col xs={24} sm={16}>
<Form.TextArea
label={t('缓存创建倍率')}
extraText={t(
'默认为 5m 缓存创建倍率1h 缓存创建倍率按固定乘法自动计算(当前为 1.6x',
)}
placeholder={t('为一个 JSON 文本,键为模型名称,值为倍率')}
field={'CreateCacheRatio'}
autosize={{ minRows: 6, maxRows: 12 }}
trigger='blur'
stopValidateWithError
rules={[
{
validator: (rule, value) => verifyJSON(value),
message: '不是合法的 JSON 字符串',
},
]}
onChange={(value) =>
setInputs({ ...inputs, CreateCacheRatio: value })
}
/>
</Col>
</Row>
<Row gutter={16}>
<Col xs={24} sm={16}>
<Form.TextArea