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"
This commit is contained in:
sherylZhaoCode
2023-05-01 15:51:34 -07:00
committed by GitHub
parent 21335d43b2
commit 145ff23fb1

View File

@@ -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.