From fb80af05be6998f4224d7f1f45541e078efe5beb Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 5 Apr 2024 16:45:18 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A0=20fix(Cohere):=20map=20to=20expect?= =?UTF-8?q?ed=20SDK=20params=20(#2329)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/clients/llm/createCoherePayload.js | 10 +++++----- docs/install/configuration/ai_endpoints.md | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/app/clients/llm/createCoherePayload.js b/api/app/clients/llm/createCoherePayload.js index d399f7055a..58803d76f3 100644 --- a/api/app/clients/llm/createCoherePayload.js +++ b/api/app/clients/llm/createCoherePayload.js @@ -69,13 +69,13 @@ function createCoherePayload({ modelOptions }) { return { message: latestUserMessageContent, model: model, - chat_history: chatHistory, + chatHistory, stream: stream ?? false, temperature: temperature, - frequency_penalty: frequency_penalty, - presence_penalty: presence_penalty, - max_tokens: max_tokens, - stop_sequences: stop, + frequencyPenalty: frequency_penalty, + presencePenalty: presence_penalty, + maxTokens: max_tokens, + stopSequences: stop, preamble, p: top_p, ...rest, diff --git a/docs/install/configuration/ai_endpoints.md b/docs/install/configuration/ai_endpoints.md index d6142c7f91..787f43898b 100644 --- a/docs/install/configuration/ai_endpoints.md +++ b/docs/install/configuration/ai_endpoints.md @@ -23,13 +23,13 @@ Some of the endpoints are marked as **Known,** which means they might have speci - Experimental: does not follow OpenAI-spec, uses a new method for endpoint compatibility, shares some similarities and parameters. - For a full list of Cohere-specific parameters, see the [Cohere API documentation](https://docs.cohere.com/reference/chat). - Note: The following parameters are recognized between OpenAI and Cohere. Most are removed in the example config below to prefer Cohere's default settings: - - `stop`: mapped to `stop_sequences` + - `stop`: mapped to `stopSequences` - `top_p`: mapped to `p`, different min/max values - - `frequency_penalty`: different min/max values - - `presence_penalty`: different min/max values + - `frequency_penalty`: mapped to `frequencyPenalty`, different min/max values + - `presence_penalty`: mapped to `presencePenalty`, different min/max values - `model`: shared, included by default. - `stream`: shared, included by default. - - `max_tokens`: shared, not included by default. + - `max_tokens`: shared, mapped to `maxTokens`, not included by default. ```yaml