Skip to main content
Execution behavior validation ensures your agent follows the expected workflow. Verify tool selection, parameter values, execution order, and sequence compliance using flow validators.

Example

This example demonstrates how to validate complex execution flows with parallel tool execution and sequential processing using nested seq! and parallel! validators.

Eval Configuration

evals.yaml

Agent Implementation

agent.py

Running Evaluations

How It Works

  1. Initial Processing: The agent starts with an LLM call to understand the request.
  2. Parallel Execution: Two tools (get_datetime and get_weather) execute in parallel using parallel!, improving efficiency by fetching independent data simultaneously.
  3. Sequential Processing: After parallel execution completes, search_flights runs sequentially, as it may depend on the previous results.
  4. Final Processing: A final LLM call synthesizes all the gathered information into a response.
  5. Validation: The seq! validator ensures:
    • Tools execute in the correct order
    • Parallel tools run simultaneously (overlapping execution times)
    • Tool inputs match expected values using nested validators

Evaluation Results

Successful Validation

When the agent follows the expected workflow with parallel and sequential execution:

Failed Validation

When the agent doesn’t follow the expected execution pattern:

Key Features

  • Nested Flow Validation: Combine seq! and parallel! to validate complex execution patterns
  • Parallel Execution: Use parallel! to ensure independent tools run simultaneously for better performance
  • Sequential Processing: Use seq! to enforce order when tools depend on previous results
  • Tool Input Validation: Validate tool input parameters using nested validators within flow validators
  • Span Validation: Validate individual span properties (input, output, elapsed, usage) within sequences
  • Workflow Compliance: Ensure agents follow expected execution patterns and optimize tool usage