-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_agent.py
More file actions
34 lines (27 loc) · 976 Bytes
/
Copy pathtest_agent.py
File metadata and controls
34 lines (27 loc) · 976 Bytes
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
# test_agent.py
# Test a single agent in isolation. 1 API call, not 5.
# Usage: python test_agent.py <agent_name>
# Example: python test_agent.py invalidation
import sys
import json
from datetime import datetime, timezone
from state.schema import DEALtaState
def load(path):
with open(path) as f:
return f.read()
# Load a saved pipeline output as the base state
with open("pipeline_output.json") as f:
base_state = json.load(f)
agent_name = sys.argv[1] if len(sys.argv) > 1 else None
if agent_name == "invalidation":
from agents import invalidation
result = invalidation.run(base_state)
print(json.dumps(result.get("sign_offs", []), indent=2))
elif agent_name == "dependency":
from agents import dependency
result = dependency.run(base_state)
print(json.dumps(result.get("compound_risks", []), indent=2))
# Add more agents as needed
else:
print(f"Unknown agent: {agent_name}")
print("Available: invalidation, dependency")