__init__.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. """
  2. demand_grade_agent 工具包
  3. 批次选词(哪些需求词、多少个)由外部调度任务负责,agent 只处理调用方在
  4. 用户消息里显式给出的需求词,不提供“列出/分页遍历需求池”类工具。
  5. """
  6. from __future__ import annotations
  7. from collections.abc import Callable
  8. from typing import Any
  9. from agents.demand_grade_agent.tools.batch_save_demand_grades import batch_save_demand_grades
  10. from agents.demand_grade_agent.tools.query_category_path import query_category_path
  11. from agents.demand_grade_agent.tools.query_demand_category_and_weight import (
  12. query_demand_category_and_weight,
  13. )
  14. from agents.demand_grade_agent.tools.query_demand_popularity_by_word import (
  15. query_demand_popularity_by_word,
  16. )
  17. from agents.demand_grade_agent.tools.query_latest_biz_dt import query_latest_biz_dt
  18. from agents.demand_grade_agent.tools.query_score_distribution import query_score_distribution
  19. from agents.demand_grade_agent.tools.search_related_pool_demands import (
  20. search_related_pool_demands,
  21. )
  22. from supply_agent.tools.registry import ToolRegistry
  23. ALL_TOOLS: list[Callable[..., Any]] = [
  24. query_latest_biz_dt,
  25. search_related_pool_demands,
  26. query_demand_category_and_weight,
  27. query_category_path,
  28. query_demand_popularity_by_word,
  29. query_score_distribution,
  30. batch_save_demand_grades,
  31. ]
  32. __all__ = [
  33. "ALL_TOOLS",
  34. "batch_save_demand_grades",
  35. "query_category_path",
  36. "query_demand_category_and_weight",
  37. "query_demand_popularity_by_word",
  38. "query_latest_biz_dt",
  39. "query_score_distribution",
  40. "register_all_tools",
  41. "search_related_pool_demands",
  42. ]
  43. def register_all_tools(registry: ToolRegistry) -> ToolRegistry:
  44. """将 demand_grade_agent 包内的所有工具注册到 ToolRegistry。"""
  45. return registry.from_decorated(*ALL_TOOLS)