forked from microsoft/AIOpsLab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_flash_single.py
More file actions
32 lines (24 loc) · 1 KB
/
test_flash_single.py
File metadata and controls
32 lines (24 loc) · 1 KB
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
#!/usr/bin/env python3
# Modified Flash agent to run a single scenario for testing
import asyncio
import logging
from typing import List, Dict, Tuple, Any
from pydantic import BaseModel
from clients.utils.llm import GPT4Turbo
from aiopslab.orchestrator import Orchestrator
# Import the FlashAgent class from the original file
import sys
sys.path.append('.')
from clients.flash import FlashAgent
if __name__ == "__main__":
# Test with just one scenario instead of 12
pid = "k8s_target_port-misconfig-detection-2" # Single scenario for testing
print(f"Running Flash agent with scenario: {pid}")
flash_agent = FlashAgent()
orchestrator = Orchestrator()
orchestrator.register_agent(flash_agent, name="flash")
problem_desc, instructions, apis = orchestrator.init_problem(pid)
flash_agent.init_context(problem_desc, instructions, apis)
print("Starting Flash agent scenario...")
asyncio.run(orchestrator.start_problem(max_steps=20))
print("Flash agent scenario completed!")