File size: 5,866 Bytes
8c10cf2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | # Complete Reference Trajectory Configuration - EmailResponder Project
#
# Version: Ideal trajectory based on code design (applicable to all models)
# Principle: Only includes steps explicitly required by code design, not based on test statistics
#
# Code Design Analysis:
# 1. Required tool: Fetch New Emails
# - tasks.yaml Line 14: "Use the exact tool name 'Fetch New Emails'"
#
# 2. Required tool: Create Email Draft
# - tasks.yaml Line 122: "If auto_create_drafts is enabled, use..."
# - main.py Line 55: auto_create_drafts=True (hardcoded)
#
# 3. Recommended tool: Get Gmail Thread
# - crew.py: Both Agents are configured with this tool
# - Purpose: Get email thread context, improve analysis and response quality
# - Location: filter_emails_task and generate_responses_task
# Project name
project_name: "EmailResponder"
# Trajectory extraction type configuration
# As per user requirements, focus on: SPAN, Chain, AGENT, LLM, Tool
# Not concerned with: Task Created, Crew Created and other non-core content
extract_types:
- "SPAN" # Level 1: Top-level execution span
- "Chain" # Level 2: Crew execution chain
- "AGENT" # Level 3: Agent execution
- "LLM" # Level 4: LLM calls
- "Tool" # Level 4: Tool calls
# ============================================================================
# Reference Trajectory (Ground Truth) - Based on code design
# ============================================================================
#
# Graphical structure (ideal execution path):
#
# [SPAN] email_auto_responder
# └─ [Chain] Crew***.kickoff
# ├─ [AGENT] Senior Email Analysis and Classification Specialist ← Task 1
# │ ├─ [LLM] <model> ← Decide to call tool
# │ ├─ [Tool] Fetch New Emails ← Required: Fetch emails
# │ └─ [LLM] <model> ← Process tool results
# │
# ├─ [AGENT] Senior Email Analysis and Classification Specialist ← Task 2
# │ └─ [LLM] <model> ← Analyze emails (no tool calls)
# │
# └─ [AGENT] Expert Professional Email Response Composer ← Task 3
# ├─ [LLM] <model> ← Generate response content
# ├─ [Tool] Create Email Draft ← Required: Create draft (auto_create_drafts=True)
# └─ [LLM] <model> ← Confirm completion
#
# Design rationale (based on Mock mode):
# - Task 1: tasks.yaml Line 14 explicitly requires using Fetch New Emails
# - Task 2: tasks.yaml Line 35 prohibits re-fetching emails
# In Mock mode, Fetch New Emails already returns all available info (snippet),
# Get Gmail Thread won't provide additional value, so not called
# - Task 3: tasks.yaml Line 122 requires creating draft when auto_create_drafts=True
# main.py Line 55: auto_create_drafts=True (hardcoded)
#
# Note: <model> represents any LLM, not limited to specific model
# ============================================================================
reference_trajectory:
# ===== Level 1: SPAN =====
- "SPAN: email_auto_responder"
# ===== Level 2: Chain (wildcard handling for UUID) =====
- "Chain: Crew***.kickoff"
# ===== Task 1: fetch_emails_task =====
# Required: Fetch New Emails (explicitly required by tasks.yaml)
- "Agent: Senior Email Analysis and Classification Specialist"
- "LLM: *" # Any model
- "Tool: Fetch New Emails"
- "LLM: *"
# ===== Task 2: filter_emails_task =====
# Only analyze emails, no tool calls (Fetch New Emails already returns all info in Mock mode)
- "Agent: Senior Email Analysis and Classification Specialist"
- "LLM: *"
# ===== Task 3: generate_responses_task =====
# Required: Create Email Draft (auto_create_drafts=True)
# Note: Get Gmail Thread is optional in Task 3, not mandatory
- "Agent: Expert Professional Email Response Composer and Communication Strategist"
- "LLM: *"
- "Tool: Create Email Draft"
- "LLM: *"
# Target tools list (for single-tool use metric)
# Only includes actual tool calls, used to detect tool usage
target_tools:
# Tools (standard format: capitalized + space)
- "Tool: Fetch New Emails"
- "Tool: Get Gmail Thread"
- "Tool: Create Email Draft"
# Models to evaluate
models:
- "GPT-5"
- "GPT-4o-mini"
- "DeepSeek-V3-1"
- "DeepSeek-R1"
- "Gemini-2.5-flash"
- "Gemini-2.5-flash-nothinking"
- "Qwen3-235b"
# Usage instructions:
#
# 1. Trajectory hierarchy (as per user requirements):
# - Top: SPAN (email_auto_responder)
# - Second level: Chain (Crew***.kickoff, wildcard handles UUID)
# - Third level: AGENT (specific Agent names, must match exactly)
# - Fourth level: LLM and Tool (alternating)
#
# 2. Wildcard handling:
# - Crew_b02af339-6c40-4ecb-b174-ec6fbe8e2081.kickoff -> Crew***.kickoff
# - Script automatically unifies Crew_UUID.kickoff format to Crew***.kickoff
#
# 3. Exact match requirements:
# - SPAN name: exact match "email_auto_responder"
# - Chain name: wildcard match "Crew***.kickoff"
# - AGENT name: exact match (e.g. "Senior Email Analysis and Classification Specialist")
# - LLM name: exact match model name (e.g. "gpt-4o-mini")
# - Tool name: exact match tool name (e.g. "Fetch New Emails")
#
# 4. Evaluation metrics meaning:
# - Exact Match: requires all nodes to be identical (including LLM call count)
# - In-order Match: allows extra LLM calls, but core sequence must be in order
# - Any-order Match: only requires containing all necessary nodes
# - Precision/Recall: calculate accuracy and recall for all nodes
#
# 5. Run command:
# python3 evaluate_trajectory.py --config reference_trajectory_complete.yaml
#
# 6. Notes:
# - Different models may have different LLM call counts (thinking, retries, etc.)
# - Complete trajectory evaluation is stricter than evaluating Tool only
# - Exact Match score may be low, recommend focusing on In-order Match and Any-order Match
|