system_prompt added to the anthropic class. See #549

This commit is contained in:
mic 2025-12-07 18:07:57 +01:00
parent 6211fa5a85
commit ea67c56d22

View file

@ -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,
}), }),