feat(agent): 增强 Agent 配置,新增结构化字段与聊天功能支持

This commit is contained in:
hugo committed 2026-07-07 11:10:32 +08:00
1 parent ac4262cd75
commit c8ce77199e
183 files changed
+11690 -2300

No files matched your search

+3 -6
View File
@@ -9,7 +9,6 @@ class Text2SQLService:
_schema_text = None
_oracle_client_initialized = False
_oracle_dll_handles = []
_ASSET_AGENT_NAMES = {"固资管理"}
_ASSET_ALLOWED_OPERATING_CENTER_CODES = ("HXJM", "HTT", "HTE")
_ASSET_CHAT_RESULT_LIMIT = 10
_DEFAULT_RESULT_LIMIT = 50
@@ -522,13 +521,11 @@ class Text2SQLService:
text = re.sub(r"(?<=\d{4}/\d{2}/\d{2})\s+00:00:00$", "", text)
return text
@staticmethod
def _agent_name(agent) -> str:
return str(getattr(agent, "name", "") or "").strip()
@classmethod
def _is_asset_management_agent(cls, agent) -> bool:
return cls._agent_name(agent) in cls._ASSET_AGENT_NAMES
from app.services.agent_registry.resolver import agent_has_erp_kb
return agent_has_erp_kb(agent)
@classmethod
def _refine_asset_query(cls, query: str, agent=None) -> str: