mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-08 10:25:28 +08:00
增加不同上下文模式
This commit is contained in:
@@ -46,6 +46,23 @@ export default function BehaviorSection({ t, form, setForm }) {
|
||||
<span className="text-xs text-muted-foreground block">{t('settings.thinkingInjectionDesc')}</span>
|
||||
</div>
|
||||
</label>
|
||||
<label className="text-sm space-y-2 md:col-span-2">
|
||||
<span className="text-muted-foreground">{t('settings.thinkingInjectionPrompt')}</span>
|
||||
<textarea
|
||||
rows={5}
|
||||
value={form.thinking_injection?.prompt || ''}
|
||||
placeholder={form.thinking_injection?.default_prompt || ''}
|
||||
onChange={(e) => setForm((prev) => ({
|
||||
...prev,
|
||||
thinking_injection: {
|
||||
...prev.thinking_injection,
|
||||
prompt: e.target.value,
|
||||
},
|
||||
}))}
|
||||
className="w-full bg-background border border-border rounded-lg px-3 py-2 resize-y min-h-32"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">{t('settings.thinkingInjectionPromptHelp')}</p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ const DEFAULT_FORM = {
|
||||
auto_delete: { mode: 'none' },
|
||||
history_split: { enabled: false, trigger_after_turns: 1 },
|
||||
current_input_file: { enabled: true, min_chars: 0 },
|
||||
thinking_injection: { enabled: true },
|
||||
thinking_injection: { enabled: true, prompt: '', default_prompt: '' },
|
||||
model_aliases_text: '{}',
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ function fromServerForm(data) {
|
||||
},
|
||||
thinking_injection: {
|
||||
enabled: data.thinking_injection?.enabled ?? true,
|
||||
prompt: data.thinking_injection?.prompt || '',
|
||||
default_prompt: data.thinking_injection?.default_prompt || '',
|
||||
},
|
||||
model_aliases_text: JSON.stringify(data.model_aliases || {}, null, 2),
|
||||
}
|
||||
@@ -116,6 +118,7 @@ function toServerPayload(form) {
|
||||
},
|
||||
thinking_injection: {
|
||||
enabled: Boolean(form.thinking_injection?.enabled ?? true),
|
||||
prompt: String(form.thinking_injection?.prompt || '').trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user