RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
API refactor: stats_api and plugin_api (#14324)
Wang Qi4458763a93df
diff --git a/api/apps/plugin_app.py b/api/apps/restful_apis/plugin_api.pysimilarity index 93%rename from api/apps/plugin_app.pyrename to api/apps/restful_apis/plugin_api.pyindex fb0a7bb610..6d53fbc626 100644--- a/api/apps/plugin_app.py+++ b/api/apps/restful_apis/plugin_api.py@@ -21,7 +21,7 @@ from api.utils.api_utils import get_json_resultfrom agent.plugin import GlobalPluginManager[email protected]('/llm_tools', methods=['GET']) # noqa: F821[email protected]('/plugin/tools', methods=['GET']) # noqa: F821@login_requireddef llm_tools() -> Response:tools = GlobalPluginManager.get_llm_tools()diff --git a/api/apps/api_app.py b/api/apps/restful_apis/stats_api.pysimilarity index 97%rename from api/apps/api_app.pyrename to api/apps/restful_apis/stats_api.pyindex 0d5d62334e..7185194327 100644--- a/api/apps/api_app.py+++ b/api/apps/restful_apis/stats_api.py@@ -20,7 +20,7 @@ from api.db.services.user_service import UserTenantServicefrom api.utils.api_utils import get_data_error_result, get_json_result, server_error_responsefrom api.apps import login_required, current_user[email protected]('/stats', methods=['GET']) # noqa: F821[email protected]('/system/stats', methods=['GET']) # noqa: F821@login_requireddef stats():try:diff --git a/test/testcases/test_web_api/test_common.py b/test/testcases/test_web_api/test_common.pyindex d81d3736e2..aa525c6edb 100644--- a/test/testcases/test_web_api/test_common.py+++ b/test/testcases/test_web_api/test_common.py@@ -38,7 +38,7 @@ API_APP_URL = f"/{VERSION}/api"SYSTEM_APP_URL = f"/{VERSION}/system"SYSTEM_API_URL = f"/api/{VERSION}/system"LLM_APP_URL = f"/{VERSION}/llm"-PLUGIN_APP_URL = f"/{VERSION}/plugin"+PLUGIN_APP_URL = f"/api/{VERSION}/plugin"SEARCHES_URL = f"/api/{VERSION}/searches"CHATS_URL = f"/api/{VERSION}/chats"@@ -118,7 +118,7 @@ def llm_list(auth, params=None, *, headers=HEADERS):# PLUGIN APPdef plugin_llm_tools(auth, params=None, *, headers=HEADERS):- res = requests.get(url=f"{HOST_ADDRESS}{PLUGIN_APP_URL}/llm_tools", headers=headers, auth=auth, params=params)+ res = requests.get(url=f"{HOST_ADDRESS}{PLUGIN_APP_URL}/tools", headers=headers, auth=auth, params=params)return res.json()diff --git a/test/testcases/test_web_api/test_plugin_app/test_llm_tools.py b/test/testcases/test_web_api/test_plugin_app/test_llm_tools.pyindex 2dfe08defe..75a18b20bd 100644--- a/test/testcases/test_web_api/test_plugin_app/test_llm_tools.py+++ b/test/testcases/test_web_api/test_plugin_app/test_llm_tools.py@@ -74,7 +74,7 @@ def _load_plugin_app(monkeypatch):stub_plugin.GlobalPluginManager = _StubGlobalPluginManagermonkeypatch.setitem(sys.modules, "agent.plugin", stub_plugin)- module_path = Path(__file__).resolve().parents[4] / "api" / "apps" / "plugin_app.py"+ module_path = Path(__file__).resolve().parents[4] / "api" / "apps" / "restful_apis" / "plugin_api.py"spec = importlib.util.spec_from_file_location("test_plugin_app_unit", module_path)module = importlib.util.module_from_spec(spec)module.manager = _DummyManager()diff --git a/web/src/utils/api.ts b/web/src/utils/api.tsindex 462384f2f2..37000decda 100644--- a/web/src/utils/api.ts+++ b/web/src/utils/api.ts@@ -51,7 +51,7 @@ export default {boxWebAuthResult: () => `${restAPIv1}/connectors/box/oauth/web/result`,// plugin- llmTools: `${webAPI}/plugin/llm_tools`,+ llmTools: `${restAPIv1}/plugin/tools`,chatsTranscriptions: `${restAPIv1}/chat/audio/transcription`,