mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-07 14:03:26 +00:00
openai[patch]: fix azure open lc serialization, release 0.1.5 (#21159)
This commit is contained in:
@@ -72,6 +72,18 @@ class AzureOpenAI(BaseOpenAI):
|
||||
"""Get the namespace of the langchain object."""
|
||||
return ["langchain", "llms", "openai"]
|
||||
|
||||
@property
|
||||
def lc_secrets(self) -> Dict[str, str]:
|
||||
return {
|
||||
"openai_api_key": "AZURE_OPENAI_API_KEY",
|
||||
"azure_ad_token": "AZURE_OPENAI_AD_TOKEN",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def is_lc_serializable(cls) -> bool:
|
||||
"""Return whether this model can be serialized by Langchain."""
|
||||
return True
|
||||
|
||||
@root_validator()
|
||||
def validate_environment(cls, values: Dict) -> Dict:
|
||||
"""Validate that api key and python package exists in environment."""
|
||||
|
Reference in New Issue
Block a user