feat(agent): update import paths for gns3_copilot modules

Updated import statements across multiple agent files to use absolute paths starting with `gns3server.agent.gns3_copilot` instead of relative `gns3_copilot` imports. This ensures proper module resolution within the gns3-server package structure and prevents import errors when the agent is executed from different contexts.
This commit is contained in:
YueGuobin committed 2026-03-04 12:27:50 +08:00
1 parent 73de248381
commit dde2a00c5b
17 files changed
+36 -28

No files matched your search

@@ -43,17 +43,17 @@ from typing_extensions import TypedDict
import logging
from gns3_copilot.agent.model_factory import (
from gns3server.agent.gns3_copilot.agent.model_factory import (
create_base_model_with_tools,
create_title_model,
)
from gns3_copilot.gns3_client import GNS3TopologyTool
from gns3_copilot.prompts import TITLE_PROMPT, load_system_prompt
from gns3server.agent.gns3_copilot.gns3_client import GNS3TopologyTool
from gns3server.agent.gns3_copilot.prompts import TITLE_PROMPT, load_system_prompt
import sys
from pathlib import Path
# Add backend to path for prompt_manager
sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent / "backend"))
from gns3_copilot.tools_v2 import (
from gns3server.agent.gns3_copilot.tools_v2 import (
ExecuteMultipleDeviceCommands,
GNS3CreateNodeTool,
GNS3LinkTool,
@@ -12,7 +12,7 @@ from uuid import UUID
from langchain.chat_models import init_chat_model
from gns3_copilot.gns3_client import get_llm_config
from gns3server.agent.gns3_copilot.gns3_client import get_llm_config
logger = logging.getLogger(__name__)