diff --git a/js/api/ollama.js b/js/api/ollama.js index 5cc41215..5c10763a 100644 --- a/js/api/ollama.js +++ b/js/api/ollama.js @@ -22,12 +22,14 @@ export class Ollama { model = ''; stream = false; num_ctx = 0; + think = false; - constructor(host, model, stream = false, num_ctx = 0) { + constructor(host, model, stream = false, num_ctx = 0, think = false) { this.host = host.trim().replace(/\/+$/, ""); this.model = model; this.stream = stream; this.num_ctx = num_ctx; + this.think = think; } fetchModels = async () => { @@ -80,7 +82,8 @@ export class Ollama { model: this.model, messages: messages, stream: this.stream, - ...(this.num_ctx > 0 ? { options: { num_ctx: parseInt(this.num_ctx) } } : {}) + think: this.think, + ...(this.num_ctx > 0 ? { options: { num_ctx: parseInt(this.num_ctx) } } : {}), }), }); return response;