Azure
You can use your Azure API key to run LLM evaluations using UpTrain.
How to do it?
Install UpTrain
Create your data
You can define your data as a list of dictionaries to run evaluations on UpTrain
question
: The question you want to askcontext
: The context relevant to the questionresponse
: The response to the question
Enter your AZURE API details
Create an EvalLLM Evaluator
The model name should start with azure/
for UpTrain to recognize you are using models hosted on Azure.
For example if you are using gpt-35-turbo
via Azure, the model name should be azure/gpt-35-turbo
Evaluate data using UpTrain
Now that we have our data, we can evaluate it using UpTrain. We use the evaluate
method to do this. This method takes the following arguments:
data
: The data you want to log and evaluatechecks
: The evaluations you want to perform on your data
We have used the following 3 metrics from UpTrain’s library:
- Context Relevance: Evaluates how relevant the retrieved context is to the question specified.
- Factual Accuracy: Evaluates whether the response generated is factually correct and grounded by the provided context.
- Response Relevance: Evaluates how relevant the generated response was to the question specified.
- Tonality: Evaluates whether the generated response matches the required persona’s tone
You can look at the complete list of UpTrain’s supported metrics here
Print the results
Sample response: