__init__.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_local_heat import query_category_local_heat
  11. from agents.demand_grade_agent.tools.query_category_path import query_category_path
  12. from agents.demand_grade_agent.tools.query_demand_category_and_weight import (
  13. query_demand_category_and_weight,
  14. )
  15. from agents.demand_grade_agent.tools.query_demand_popularity_by_word import (
  16. query_demand_popularity_by_word,
  17. )
  18. from agents.demand_grade_agent.tools.query_latest_biz_dt import query_latest_biz_dt
  19. from agents.demand_grade_agent.tools.query_score_distribution import query_score_distribution
  20. from agents.demand_grade_agent.tools.search_related_pool_demands import (
  21. search_related_pool_demands,
  22. )
  23. from supply_agent.tools.registry import ToolRegistry
  24. ALL_TOOLS: list[Callable[..., Any]] = [
  25. query_latest_biz_dt,
  26. search_related_pool_demands,
  27. query_demand_category_and_weight,
  28. query_category_path,
  29. query_category_local_heat,
  30. query_demand_popularity_by_word,
  31. query_score_distribution,
  32. batch_save_demand_grades,
  33. ]
  34. __all__ = [
  35. "ALL_TOOLS",
  36. "batch_save_demand_grades",
  37. "query_category_local_heat",
  38. "query_category_path",
  39. "query_demand_category_and_weight",
  40. "query_demand_popularity_by_word",
  41. "query_latest_biz_dt",
  42. "query_score_distribution",
  43. "register_all_tools",
  44. "search_related_pool_demands",
  45. ]
  46. def register_all_tools(registry: ToolRegistry) -> ToolRegistry:
  47. """将 demand_grade_agent 包内的所有工具注册到 ToolRegistry。"""
  48. return registry.from_decorated(*ALL_TOOLS)