system_prompt added to the anthropic class. See #549
This commit is contained in:
parent
6211fa5a85
commit
ea67c56d22
1 changed files with 4 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ export class Anthropic {
|
||||||
apiKey = '';
|
apiKey = '';
|
||||||
version = '';
|
version = '';
|
||||||
model = '';
|
model = '';
|
||||||
|
system_prompt = '';
|
||||||
max_tokens = 4096;
|
max_tokens = 4096;
|
||||||
stream = false;
|
stream = false;
|
||||||
|
|
||||||
|
|
@ -31,12 +32,14 @@ export class Anthropic {
|
||||||
apiKey = '',
|
apiKey = '',
|
||||||
version = '',
|
version = '',
|
||||||
model = '',
|
model = '',
|
||||||
|
system_prompt = '',
|
||||||
max_tokens = 4096,
|
max_tokens = 4096,
|
||||||
stream = false,
|
stream = false,
|
||||||
} = {}) {
|
} = {}) {
|
||||||
this.apiKey = apiKey;
|
this.apiKey = apiKey;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
|
this.system_prompt = system_prompt;
|
||||||
this.max_tokens = max_tokens > 0 ? max_tokens : 4096;
|
this.max_tokens = max_tokens > 0 ? max_tokens : 4096;
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
}
|
}
|
||||||
|
|
@ -95,6 +98,7 @@ export class Anthropic {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: this.model,
|
model: this.model,
|
||||||
max_tokens: this.max_tokens,
|
max_tokens: this.max_tokens,
|
||||||
|
system: this.system_prompt,
|
||||||
messages: messages,
|
messages: messages,
|
||||||
stream: this.stream,
|
stream: this.stream,
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue