From 145ff23fb1a6cf16f503788d392cdc96352568fc Mon Sep 17 00:00:00 2001 From: sherylZhaoCode <59749074+sherylZhaoCode@users.noreply.github.com> Date: Mon, 1 May 2023 15:51:34 -0700 Subject: [PATCH] correct the llm type of AzureOpenAI (#3721) The llm type of AzureOpenAI was previously set to default, which is openai. But since AzureOpenAI has different API from openai, it creates problems when doing chain saving and loading. This PR corrected the llm type of AzureOpenAI to "azure" --- langchain/llms/openai.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/langchain/llms/openai.py b/langchain/llms/openai.py index 7e374d26b7..b29cbf6054 100644 --- a/langchain/llms/openai.py +++ b/langchain/llms/openai.py @@ -589,6 +589,11 @@ class AzureOpenAI(BaseOpenAI): def _invocation_params(self) -> Dict[str, Any]: return {**{"engine": self.deployment_name}, **super()._invocation_params} + @property + def _llm_type(self) -> str: + """Return type of llm.""" + return "azure" + class OpenAIChat(BaseLLM): """Wrapper around OpenAI Chat large language models.