__init__.py 2.1 KB

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