AzureOpenAI Provider¶
Below is how you can instantiate AzureOpenAI as a provider.
Additionally, all feedback functions listed in these two classes can be run with AzureOpenAI:
trulens_eval.feedback.provider.openai.AzureOpenAI
¶
Bases: OpenAI
Out of the box feedback functions calling AzureOpenAI APIs. Has the same functionality as OpenAI out of the box feedback functions. Please export the following env variables. These can be retrieved from https://oai.azure.com/ .
- AZURE_OPENAI_ENDPOINT
- AZURE_OPENAI_API_KEY
- OPENAI_API_VERSION
Deployment name below is also found on the oai azure page.
Example
from trulens_eval.feedback.provider.openai import AzureOpenAI
openai_provider = AzureOpenAI(deployment_name="...")
openai_provider.relevance(
prompt="Where is Germany?",
response="Poland is in Europe."
) # low relevance
PARAMETER | DESCRIPTION |
---|---|
deployment_name |
The name of the deployment.
TYPE:
|