Spaces:
Sleeping
Sleeping
Download agentgraph/testing/__init__.py from holistic-ai/AgentGraph: direct link, hf CLI and curl.
- Browser
- Download file 1.8 kB
-
https://huggingface.co/spaces/holistic-ai/AgentGraph/resolve/5d5103b4e4e5e7ed5e46be7c31e4cbbbbfe952b2/agentgraph/testing/__init__.py
- Command line
-
hf download hf://spaces/holistic-ai/AgentGraph@5d5103b4e4e5e7ed5e46be7c31e4cbbbbfe952b2/agentgraph/testing/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/holistic-ai/AgentGraph/resolve/5d5103b4e4e5e7ed5e46be7c31e4cbbbbfe952b2/agentgraph/testing/__init__.py
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', | |
| ] |