Skip to content

Commit

Permalink
fix(Anthropic): only pass properties defined by API reference in payl…
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila authored Sep 13, 2023
1 parent e4843c4 commit 81bda11
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions api/app/clients/AnthropicClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 81bda11

Please sign in to comment.