mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
fix(Anthropic): only pass properties defined by API reference in payload (#938)
This commit is contained in:
parent
e4843c4680
commit
81bda112d3
1 changed files with 13 additions and 2 deletions
|
|
@ -268,14 +268,25 @@ class AnthropicClient extends BaseClient {
|
||||||
};
|
};
|
||||||
|
|
||||||
let text = '';
|
let text = '';
|
||||||
const { model, stream, maxOutputTokens, ...rest } = this.modelOptions;
|
const {
|
||||||
|
stream,
|
||||||
|
model,
|
||||||
|
temperature,
|
||||||
|
maxOutputTokens,
|
||||||
|
stop: stop_sequences,
|
||||||
|
topP: top_p,
|
||||||
|
topK: top_k,
|
||||||
|
} = this.modelOptions;
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
prompt: payload,
|
prompt: payload,
|
||||||
model,
|
model,
|
||||||
stream: stream || true,
|
stream: stream || true,
|
||||||
max_tokens_to_sample: maxOutputTokens || 1500,
|
max_tokens_to_sample: maxOutputTokens || 1500,
|
||||||
|
stop_sequences,
|
||||||
|
temperature,
|
||||||
metadata,
|
metadata,
|
||||||
...rest,
|
top_p,
|
||||||
|
top_k,
|
||||||
};
|
};
|
||||||
if (this.options.debug) {
|
if (this.options.debug) {
|
||||||
console.log('AnthropicClient: requestOptions');
|
console.log('AnthropicClient: requestOptions');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue