Metrics

Metrics

In MixedVoices, metrics help you evaluate and analyze your voice agent's performance. Each metric can be either binary (PASS/FAIL) or continuous (0-10 scale), allowing for both strict checks and nuanced performance evaluation.

Built-in Metrics

MixedVoices comes with several pre-defined metrics that cover common evaluation needs:

from mixedvoices.metrics import (
    empathy,                 # Measures emotional intelligence and response appropriateness
    hallucination,          # Checks for made-up information
    conciseness,            # Evaluates response brevity and clarity
    context_awareness,      # Assesses understanding of conversation context
    adaptive_qa,            # Measures ability to handle follow-up questions
    objection_handling,     # Evaluates handling of customer objections
    scheduling,             # Assesses appointment scheduling accuracy
    verbatim_repetition,    # Checks for unnecessary repetition
)

# Get all default metrics at once
from mixedvoices.metrics import get_all_default_metrics
metrics = get_all_default_metrics()

Creating Custom Metrics

You can create custom metrics to evaluate specific aspects of your agent's performance:

Using Metrics in Projects

Metrics can be added when creating a project or updated later:

Example: Metric Set

Evaluation with Metrics

When creating an evaluator, you can choose which metrics to use. Check Agent Evaluation for more details.

Tips

Creating Effective Metrics

  1. Clear Definitions: Make metric definitions specific and measurable

  2. Appropriate Scoring: Choose binary for pass/fail requirements, continuous for nuanced evaluation

  3. Prompt Awareness: Use include_prompt=True for metrics that need to check against agent knowledge

  4. Consistent Naming: Use lowercase, descriptive names without spaces

Last updated