092_agent_api / tools /chat_tools.py
anhkhoiphan's picture
Thay đổi logic tool RAG
dd53ab9
raw
history blame contribute delete
944 Bytes
"""
Re-exports real tools (memory, scheduler, summarizer) as LangChain tools.
Replaces the previous mock implementations.
"""
# Import modules so register_tool decorators fire and populate base.TOOLS
from . import memory as _memory_mod # noqa: F401
from . import scheduler as _scheduler_mod # noqa: F401
from . import summarizer as _summarizer_mod # noqa: F401
from . import chart as _chart_mod # noqa: F401
from . import rag as _rag_mod # noqa: F401
from .base import TOOLS as _REGISTRY, get_langchain_tools
_ALLOWED = {
# Facilitator
"summarize_chat",
"summarize_chart",
# Scheduler
"get_schedule", "add_event", "update_event", "delete_event",
"add_reminder", "get_reminders",
# Memory
"save_memory", "get_memories",
# Web
"read_link",
# Knowledge base (PDF RAG)
"rag_search",
}
TOOLS = [t for t in get_langchain_tools() if t.name in _ALLOWED]
TOOL_MAP = {t.name: t for t in TOOLS}