-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_q1.py
More file actions
37 lines (29 loc) · 1.26 KB
/
debug_q1.py
File metadata and controls
37 lines (29 loc) · 1.26 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
33
34
35
36
37
import sys
sys.path.insert(0, 'projects/telco-troubleshooting/src')
from telco_agent.track_b_agent import TrackBAgent, _extract_first_node_name, _links_from_interface_description, _links_from_arp_analysis, _ToolBudget, _execute_cli_text
from telco_agent.track_b_client import TrackBClient
question = 'The link planning data of Gamma-Aegis-01 within the Big Data Zone has been accidentally deleted, and it is necessary to supplement the description of the link connection relationships to restore the data.'
print(f"Question: {question[:80]}...")
print()
# Test extraction
local = _extract_first_node_name(question)
print(f"Extracted node: {local}")
print()
# Test with mock server
client = TrackBClient()
budget = _ToolBudget(max_calls=30)
# Try interface description first
desc = _execute_cli_text(client, budget=budget, question_number=1, device=local, command="display interface description")
print(f"Interface desc output: {desc[:200] if desc else 'EMPTY'}")
print()
links = _links_from_interface_description(local_node=local, interface_desc_output=desc)
print(f"Links from desc: {links}")
print()
# Try ARP fallback
arp_links = _links_from_arp_analysis(
client=client,
budget=budget,
question_number=1,
local_node=local
)
print(f"Links from ARP: {arp_links}")