Task Completion
Task Completion is a single-turn metric to determine an agent’s task completion score
Overview
The task completion metric is a single-turn metric that uses LLM-as-a-judge to assess whether your LLM agent successfully completes the given task based on its entire trace.
Important Note
The task completion analyzes your agent’s full trace to determine task success, which requires setting up tracing.
How Is It Calculated?
The task completion metric uses an LLM to extract the task and outcome from each step in the trace, then uses the same LLM to determine if the task was satisfied based on the outcome.
The final score is the alignment of task and outcome as extracted from the trace.
Create Locally
You can create the TaskCompletionMetric in deepeval as follows:
Here’s a list of parameters you can configure when creating a TaskCompletionMetric:
A float to represent the minimum passing threshold.
A string representing the task to be completed. If no task is supplied, it is automatically inferred from the trace.
A string specifying which of OpenAI’s GPT models to use OR any custom LLM
model of type
DeepEvalBaseLLM.
A boolean to enable the inclusion a reason for its evaluation score.
A boolean to enable concurrent execution within the measure() method.
A boolean to enforce a binary metric score: 0 for perfection, 1 otherwise.
A boolean to print the intermediate steps used to calculate the metric score.
Create Remotely
For users not using deepeval python, or want to run evals remotely on Confident AI, you can use the task completion metric by adding it to a single-turn metric collection. This will allow you to use task completion metric for:
- Single-turn E2E testing
- Online and offline evals for traces