AzureOpenAI
features and configuration options, please refer to the API reference.
Class | Package | Local | Serializable | PY support | Package downloads | Package latest |
---|---|---|---|---|---|---|
AzureOpenAI | @langchain/openai | ❌ | ✅ | ✅ |
@langchain/openai
integration package.
AzureOpenAI
constructor.
If you want to get automated tracing of your model calls you can also set your LangSmith API key by uncommenting below:
@langchain/openai
package:
openai.azure.com
, you’ll need to use the alternate AZURE_OPENAI_BASE_PATH
environment variable.
For example, here’s how you would connect to the domain https://westeurope.api.microsoft.com/openai/deployments/{DEPLOYMENT_NAME}
:
@langchain/azure-openai
package, you can update your code to use the new Azure integration following these steps:
@langchain/openai
package and remove the previous @langchain/azure-openai
package:
AzureOpenAI
and AzureChatOpenAI
classes from the @langchain/openai
package:
AzureOpenAI
and AzureChatOpenAI
classes and pass the required parameters:
azureOpenAIApiInstanceName
parameter instead of the azureOpenAIEndpoint
parameter, and adds the azureOpenAIApiVersion
parameter to specify the API version.
azureADTokenProvider
parameter to the constructor instead of credentials
, see the Azure Managed Identity section for more details.
AZURE_OPENAI_API_INSTANCE_NAME
environment variable instead of AZURE_OPENAI_API_ENDPOINT
, and add the AZURE_OPENAI_API_VERSION
environment variable to specify the API version.