ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Verify test case loading with correct field mapping"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Set dummy API key
|
||||
os.environ["KIMI_API_KEY"] = os.getenv("KIMI_API_KEY", "test-kimi-key")
|
||||
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY", "test-openai-key")
|
||||
|
||||
from config import Config
|
||||
from evaluator import UserMemoryEvaluator
|
||||
|
||||
# Initialize evaluator
|
||||
config = Config.from_env()
|
||||
evaluator = UserMemoryEvaluator(config)
|
||||
|
||||
# Load test cases
|
||||
test_cases = evaluator.load_test_cases(category="layer1")
|
||||
|
||||
if test_cases:
|
||||
print(f"\nLoaded {len(test_cases)} test cases")
|
||||
|
||||
# Check first test case
|
||||
test_id = test_cases[0]
|
||||
test_case = evaluator.test_cases[test_id]
|
||||
|
||||
print(f"\nTest Case: {test_id}")
|
||||
print(f" Title: {test_case.title}")
|
||||
print(f" Category: {test_case.category}")
|
||||
print(f" User Question: {test_case.user_question}")
|
||||
print(f" Evaluation Criteria: {test_case.evaluation_criteria[:200]}..." if test_case.evaluation_criteria else " Evaluation Criteria: None")
|
||||
print(f" Expected Behavior: {test_case.expected_behavior[:100]}..." if test_case.expected_behavior else " Expected Behavior: None")
|
||||
print(f" Conversations: {len(test_case.conversation_histories)}")
|
||||
|
||||
# Check conversation history structure
|
||||
if test_case.conversation_histories:
|
||||
conv = test_case.conversation_histories[0]
|
||||
print(f"\nFirst Conversation:")
|
||||
print(f" ID: {conv.get('conversation_id', 'N/A')}")
|
||||
print(f" Timestamp: {conv.get('timestamp', 'N/A')}")
|
||||
print(f" Messages: {len(conv.get('messages', []))}")
|
||||
print(f" Has metadata: {bool(conv.get('metadata', {}))}")
|
||||
|
||||
print("\n✓ Test case structure is correct")
|
||||
else:
|
||||
print("✗ No test cases loaded")
|
||||
Reference in New Issue
Block a user