Set no. of results used to generate chat response from Khoj Obsidian

This commit is contained in:
Debanjum Singh Solanky 2023-07-07 12:32:32 -07:00
parent 2f31de5ed5
commit 1d77fe712c
2 changed files with 2 additions and 2 deletions

View file

@ -158,7 +158,7 @@ export class KhojChatModal extends Modal {
// Get chat response from Khoj backend // Get chat response from Khoj backend
let encodedQuery = encodeURIComponent(query); let encodedQuery = encodeURIComponent(query);
let chatUrl = `${this.setting.khojUrl}/api/chat?q=${encodedQuery}&client=obsidian`; let chatUrl = `${this.setting.khojUrl}/api/chat?q=${encodedQuery}&n=${this.setting.resultsCount}&client=obsidian`;
let responseElement = this.createKhojResponseDiv(); let responseElement = this.createKhojResponseDiv();
// Temporary status message to indicate that Khoj is thinking // Temporary status message to indicate that Khoj is thinking

View file

@ -54,7 +54,7 @@ export class KhojSettingTab extends PluginSettingTab {
})); }));
new Setting(containerEl) new Setting(containerEl)
.setName('Results Count') .setName('Results Count')
.setDesc('The number of search results to show') .setDesc('The number of results to show in search and use for chat')
.addSlider(slider => slider .addSlider(slider => slider
.setLimits(1, 10, 1) .setLimits(1, 10, 1)
.setValue(this.plugin.settings.resultsCount) .setValue(this.plugin.settings.resultsCount)