mirror of
https://github.com/ahmetildirim/obsidian-inscribe.git
synced 2026-07-22 05:44:10 +00:00
Add output limit setting to profiles section with toggle and input field
This commit is contained in:
parent
b20d5bb671
commit
8646259a30
1 changed files with 25 additions and 0 deletions
|
|
@ -345,6 +345,31 @@ class ProfilesSection {
|
|||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Output Limit
|
||||
new Setting(this.container)
|
||||
.setName("Output limit")
|
||||
.setDesc(`${profile.name} | Limit the number of sentences in the output`)
|
||||
.addText((text) => {
|
||||
text.inputEl.setAttr("type", "number");
|
||||
text.inputEl.setAttr("min", "1");
|
||||
text
|
||||
.setValue(String(profile.completionOptions.outputLimit.sentences))
|
||||
.onChange(async (value) => {
|
||||
profile.completionOptions.outputLimit.sentences = parseInt(value);
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
})
|
||||
.addToggle((toggle) => {
|
||||
toggle
|
||||
.setValue(profile.completionOptions.outputLimit.enabled)
|
||||
.onChange(async (value) => {
|
||||
profile.completionOptions.outputLimit.enabled = value;
|
||||
await this.plugin.saveSettings();
|
||||
await this.render();
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
private profileDropdown(dropdown: DropdownComponent): void {
|
||||
|
|
|
|||
Loading…
Reference in a new issue