From 305ed182fc3dc974b9e180d2641c2287c2787a11 Mon Sep 17 00:00:00 2001 From: David Wu Date: Fri, 29 Mar 2024 01:15:34 -0700 Subject: [PATCH] Add openai api version for langchain --- src/copilot_langchain/chat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/copilot_langchain/chat.py b/src/copilot_langchain/chat.py index 9ac74bb..3a0cd44 100644 --- a/src/copilot_langchain/chat.py +++ b/src/copilot_langchain/chat.py @@ -38,8 +38,10 @@ async def chat_completion(messages: list[dict], stream: bool = False, convert_chat_history_cp_to_lc(messages[:-1], memory) llm = AzureChatOpenAI( + openai_api_version=os.environ["AZURE_OPENAI_API_VERSION"], azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"], azure_deployment=os.environ["AZURE_OPENAI_CHAT_DEPLOYMENT"], + openai_api_key=os.environ["AZURE_OPENAI_API_KEY"], temperature=context.get('temperature', 0.7) )