From 81bda112d337efe94f4f03ff85af357e4781b679 Mon Sep 17 00:00:00 2001 From: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:23:29 -0400 Subject: [PATCH] fix(Anthropic): only pass properties defined by API reference in payload (#938) --- api/app/clients/AnthropicClient.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/api/app/clients/AnthropicClient.js b/api/app/clients/AnthropicClient.js index 304208e49d..5c35bc28f4 100644 --- a/api/app/clients/AnthropicClient.js +++ b/api/app/clients/AnthropicClient.js @@ -268,14 +268,25 @@ class AnthropicClient extends BaseClient { }; 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 = { prompt: payload, model, stream: stream || true, max_tokens_to_sample: maxOutputTokens || 1500, + stop_sequences, + temperature, metadata, - ...rest, + top_p, + top_k, }; if (this.options.debug) { console.log('AnthropicClient: requestOptions');