feat(copilot): add tool response normalization utility

Add `normalize_tool_response` function to standardize tool output formats for consistent frontend display. The function converts various response types (dict, list, string) into a unified structure with success metrics, detailed data arrays, and metadata. This ensures backward compatibility while providing predictable response formats for UI components.
This commit is contained in:
YueGuobin committed 2026-03-04 23:41:29 +08:00
1 parent f64daa96cd
commit 4e28adffb6
3 files changed
+422 -1

No files matched your search

@@ -13,7 +13,11 @@ Author: Guobin Yue
# Import main utility functions
from .get_gns3_device_port import get_device_ports_from_topology
from .parse_tool_content import format_tool_response, parse_tool_content
from .parse_tool_content import (
format_tool_response,
normalize_tool_response,
parse_tool_content
)
# Dynamic version management
try:
@@ -33,4 +37,5 @@ __all__ = [
"get_device_ports_from_topology",
"parse_tool_content",
"format_tool_response",
"normalize_tool_response",
]