AgentGraph / agentgraph /testing /__init__.py
wu981526092's picture
🚀 Deploy AgentGraph: Complete agent monitoring and knowledge graph system
c2ea5ed
Raw
History Blame Contribute Delete
1.8 kB
"""
Perturbation Testing and Robustness Evaluation
This module handles the fourth stage of the agent monitoring pipeline:
- Testing knowledge graph robustness and reliability
- Applying various perturbation techniques (jailbreak, counterfactual bias, etc.)
- Evaluating system resistance to different types of attacks
- Generating comprehensive test reports
Architecture:
- Pure functions (recommended): Work with data dictionaries, no database dependencies
- Legacy classes (deprecated): Have database dependencies, kept for backward compatibility
Usage:
# Pure functions (recommended)
from agentgraph.testing import run_knowledge_graph_tests
from agentgraph.testing import run_jailbreak_tests, run_counterfactual_bias_tests
# Legacy classes (deprecated - use backend services instead)
from agentgraph.testing import KnowledgeGraphTester
"""
# Pure functions (recommended for new code)
from .knowledge_graph_tester import run_knowledge_graph_tests, load_litellm_config
# Import pure functions from perturbation types
from .perturbation_types.jailbreak import run_jailbreak_tests, test_relation_jailbreak, load_jailbreak_techniques
from .perturbation_types.counterfactual_bias import run_counterfactual_bias_tests, test_relation_counterfactual_bias
# Import pure utility functions
from .perturbation_types.base import (
load_techniques_from_file, validate_testing_data, prepare_testing_data
)
__all__ = [
# Pure functions (recommended)
'run_knowledge_graph_tests',
'load_litellm_config',
'run_jailbreak_tests',
'test_relation_jailbreak',
'load_jailbreak_techniques',
'run_counterfactual_bias_tests',
'test_relation_counterfactual_bias',
'load_techniques_from_file',
'validate_testing_data',
'prepare_testing_data',
]