From 22ab99cbd620ddb21d90496a68ddd9287bfdb30d Mon Sep 17 00:00:00 2001 From: Elle Neal <107104287+ellenealds@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:03:16 +0100 Subject: [PATCH] Update LLM-Connections.md (#252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding Cohere LLM Co-authored-by: João Moura --- docs/how-to/LLM-Connections.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/how-to/LLM-Connections.md b/docs/how-to/LLM-Connections.md index 1693d6efa..fad9f42b5 100644 --- a/docs/how-to/LLM-Connections.md +++ b/docs/how-to/LLM-Connections.md @@ -75,8 +75,27 @@ OPENAI_API_BASE=https://api.mistral.ai/v1 OPENAI_MODEL_NAME="mistral-small" ``` -### Azure Open AI Configuration -For Azure OpenAI API integration, set the following environment variables: +### text-gen-web-ui +```sh +OPENAI_API_BASE=http://localhost:5000/v1 +OPENAI_MODEL_NAME=NA +OPENAI_API_KEY=NA +``` + +### Cohere +```sh +from langchain_community.chat_models import ChatCohere +# Initialize language model +os.environ["COHERE_API_KEY"] = "your-cohere-api-key" +llm = ChatCohere() + +Free developer API key available here: https://cohere.com/ +Langchain Documentation: https://python.langchain.com/docs/integrations/chat/cohere +``` + +### Azure Open AI +Azure's OpenAI API needs a distinct setup, utilizing the `langchain_openai` component for Azure-specific configurations. + ```sh AZURE_OPENAI_VERSION="2022-12-01" AZURE_OPENAI_DEPLOYMENT=""