add 'think' parameter to Ollama constructor and include in fetchResponse. see #398
This commit is contained in:
parent
6cdb00444f
commit
ff8fff50c9
1 changed files with 5 additions and 2 deletions
|
|
@ -22,12 +22,14 @@ export class Ollama {
|
||||||
model = '';
|
model = '';
|
||||||
stream = false;
|
stream = false;
|
||||||
num_ctx = 0;
|
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.host = host.trim().replace(/\/+$/, "");
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
this.num_ctx = num_ctx;
|
this.num_ctx = num_ctx;
|
||||||
|
this.think = think;
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchModels = async () => {
|
fetchModels = async () => {
|
||||||
|
|
@ -80,7 +82,8 @@ export class Ollama {
|
||||||
model: this.model,
|
model: this.model,
|
||||||
messages: messages,
|
messages: messages,
|
||||||
stream: this.stream,
|
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;
|
return response;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue