diff --git a/src/mindpilot/app/api/api_schemas.py b/src/mindpilot/app/api/api_schemas.py index 39b0e1b..01dca66 100644 --- a/src/mindpilot/app/api/api_schemas.py +++ b/src/mindpilot/app/api/api_schemas.py @@ -15,7 +15,7 @@ from openai.types.chat import ( from ..utils.system_utils import MsgType TEMPERATURE = 0.8 -from src.mindpilot.app.utils.pydantic_v2 import AnyUrl, BaseModel, Field +from app.utils.pydantic_v2 import AnyUrl, BaseModel, Field class OpenAIBaseInput(BaseModel): diff --git a/src/mindpilot/app/chat/utils.py b/src/mindpilot/app/chat/utils.py index 4f52e6f..98ed5e8 100644 --- a/src/mindpilot/app/chat/utils.py +++ b/src/mindpilot/app/chat/utils.py @@ -1,6 +1,6 @@ from typing import List, Union from langchain.prompts.chat import ChatMessagePromptTemplate -from src.mindpilot.app.utils.pydantic_v2 import BaseModel, Field +from app.utils.pydantic_v2 import BaseModel, Field import logging from typing import Dict, Tuple diff --git a/src/mindpilot/app/knowledge_base/kb_service/es_kb_service.py b/src/mindpilot/app/knowledge_base/kb_service/es_kb_service.py index 7e7e301..4ab3180 100644 --- a/src/mindpilot/app/knowledge_base/kb_service/es_kb_service.py +++ b/src/mindpilot/app/knowledge_base/kb_service/es_kb_service.py @@ -10,7 +10,7 @@ from langchain_community.vectorstores.elasticsearch import ( ElasticsearchStore, ) -from src.mindpilot.app.utils.system_utils import get_Embeddings +from app.utils.system_utils import get_Embeddings from ...configs import KB_ROOT_PATH, kbs_config from ..file_rag.utils import get_Retriever from ..kb_service.base import KBService, SupportedVSType diff --git a/src/mindpilot/app/tools/arxiv.py b/src/mindpilot/app/tools/arxiv.py index c4ef2fa..5d7c686 100644 --- a/src/mindpilot/app/tools/arxiv.py +++ b/src/mindpilot/app/tools/arxiv.py @@ -1,5 +1,5 @@ # LangChain 的 ArxivQueryRun 工具 -from src.mindpilot.app.utils.pydantic_v1 import Field +from app.utils.pydantic_v1 import Field from .tools_registry import BaseToolOutput, regist_tool diff --git a/src/mindpilot/app/tools/calculate.py b/src/mindpilot/app/tools/calculate.py index d40ee8b..494ecea 100644 --- a/src/mindpilot/app/tools/calculate.py +++ b/src/mindpilot/app/tools/calculate.py @@ -1,4 +1,4 @@ -from src.mindpilot.app.utils.pydantic_v1 import Field +from app.utils.pydantic_v1 import Field from .tools_registry import BaseToolOutput, regist_tool diff --git a/src/mindpilot/app/tools/search_internet.py b/src/mindpilot/app/tools/search_internet.py index 2f79ab5..73de580 100644 --- a/src/mindpilot/app/tools/search_internet.py +++ b/src/mindpilot/app/tools/search_internet.py @@ -8,7 +8,7 @@ from markdownify import markdownify from strsimpy.normalized_levenshtein import NormalizedLevenshtein -from src.mindpilot.app.utils.pydantic_v1 import Field +from app.utils.pydantic_v1 import Field # from chatchat.server.utils import get_tool_config from .tools_registry import BaseToolOutput, regist_tool diff --git a/src/mindpilot/app/tools/shell.py b/src/mindpilot/app/tools/shell.py index b5abbfa..3d4b6dd 100644 --- a/src/mindpilot/app/tools/shell.py +++ b/src/mindpilot/app/tools/shell.py @@ -1,7 +1,7 @@ # LangChain 的 Shell 工具 from langchain_community.tools import ShellTool -from src.mindpilot.app.utils.pydantic_v1 import Field +from app.utils.pydantic_v1 import Field from .tools_registry import BaseToolOutput, regist_tool diff --git a/src/mindpilot/app/tools/tools_registry.py b/src/mindpilot/app/tools/tools_registry.py index d43f97e..7e6bc1e 100644 --- a/src/mindpilot/app/tools/tools_registry.py +++ b/src/mindpilot/app/tools/tools_registry.py @@ -5,7 +5,7 @@ from typing import Any, Callable, Dict, Optional, Tuple, Type, Union from langchain.agents import tool from langchain_core.tools import BaseTool -from src.mindpilot.app.utils.pydantic_v1 import BaseModel, Extra +from app.utils.pydantic_v1 import BaseModel, Extra __all__ = ["regist_tool", "BaseToolOutput"] diff --git a/src/mindpilot/app/tools/weather_check.py b/src/mindpilot/app/tools/weather_check.py index 1ed1dd1..cbc62f8 100644 --- a/src/mindpilot/app/tools/weather_check.py +++ b/src/mindpilot/app/tools/weather_check.py @@ -3,7 +3,7 @@ """ import requests -from src.mindpilot.app.utils.pydantic_v1 import Field +from app.utils.pydantic_v1 import Field from .tools_registry import BaseToolOutput, regist_tool from ..utils.system_utils import get_tool_config diff --git a/src/mindpilot/app/tools/wolfram.py b/src/mindpilot/app/tools/wolfram.py index 7f43dd9..dd8f564 100644 --- a/src/mindpilot/app/tools/wolfram.py +++ b/src/mindpilot/app/tools/wolfram.py @@ -1,6 +1,6 @@ # Langchain 自带的 Wolfram Alpha API 封装 -from src.mindpilot.app.utils.pydantic_v1 import Field +from app.utils.pydantic_v1 import Field from .tools_registry import BaseToolOutput, regist_tool from ..utils.system_utils import get_tool_config diff --git a/src/mindpilot/app/utils/system_utils.py b/src/mindpilot/app/utils/system_utils.py index b3738f3..1eedad2 100644 --- a/src/mindpilot/app/utils/system_utils.py +++ b/src/mindpilot/app/utils/system_utils.py @@ -127,11 +127,11 @@ def get_ChatOpenAI( def get_tool(name: str = None) -> Union[BaseTool, Dict[str, BaseTool]]: import importlib - from src.mindpilot.app import tools + from app import tools importlib.reload(tools) - from src.mindpilot.app.tools import tools_registry + from app.tools import tools_registry if name is None: return tools_registry._TOOLS_REGISTRY @@ -155,7 +155,7 @@ async def wrap_done(fn: Awaitable, event: asyncio.Event): def get_tool_config(name: str = None) -> Dict: - from src.mindpilot.app.configs import TOOL_CONFIG + from app.configs import TOOL_CONFIG if name is None: return TOOL_CONFIG diff --git a/src/mindpilot/main.py b/src/mindpilot/main.py index b3b9ae1..c0d275c 100644 --- a/src/mindpilot/main.py +++ b/src/mindpilot/main.py @@ -10,7 +10,7 @@ from multiprocessing import Process import argparse from fastapi import FastAPI from app.configs import HOST, PORT -from src.mindpilot.app.utils.colorful import print亮蓝 +from app.utils.colorful import print亮蓝 from app.configs import KB_INFO os.environ['HF_ENDPOINT'] = "https://hf-mirror.com" @@ -42,7 +42,7 @@ def run_api_server( ): import uvicorn from app.api.api_server import create_app - from src.mindpilot.app.utils.system_utils import set_httpx_config + from app.utils.system_utils import set_httpx_config set_httpx_config() app = create_app(run_mode=run_mode)