__init__.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. """
  2. find_agent 工具包
  3. 在此注册本 Agent 专属的工具。
  4. """
  5. from __future__ import annotations
  6. from collections.abc import Callable
  7. from typing import Any
  8. from agents.find_agent.tools.douyin_detail import douyin_detail
  9. from agents.find_agent.tools.douyin_search import douyin_search
  10. from agents.find_agent.tools.douyin_search_tikhub import douyin_search_tikhub
  11. from agents.find_agent.tools.douyin_user_videos import douyin_user_videos
  12. from agents.find_agent.tools.decision_support import (
  13. normalize_age_portraits,
  14. )
  15. from agents.find_agent.tools.hotspot_profile import (
  16. batch_fetch_portraits,
  17. get_account_fans_portrait,
  18. get_content_fans_portrait,
  19. )
  20. from agents.find_agent.tools.video_discovery_store import (
  21. batch_save_video_candidate_evaluations,
  22. create_video_discovery_run,
  23. query_video_discovery_state,
  24. record_video_search_page,
  25. )
  26. from supply_agent.tools.registry import ToolRegistry
  27. ALL_TOOLS: list[Callable[..., Any]] = [
  28. douyin_search,
  29. douyin_search_tikhub,
  30. douyin_user_videos,
  31. douyin_detail,
  32. get_content_fans_portrait,
  33. get_account_fans_portrait,
  34. batch_fetch_portraits,
  35. normalize_age_portraits,
  36. create_video_discovery_run,
  37. record_video_search_page,
  38. batch_save_video_candidate_evaluations,
  39. query_video_discovery_state,
  40. ]
  41. __all__ = [
  42. "ALL_TOOLS",
  43. "douyin_search",
  44. "douyin_search_tikhub",
  45. "douyin_user_videos",
  46. "douyin_detail",
  47. "get_content_fans_portrait",
  48. "get_account_fans_portrait",
  49. "batch_fetch_portraits",
  50. "normalize_age_portraits",
  51. "create_video_discovery_run",
  52. "record_video_search_page",
  53. "batch_save_video_candidate_evaluations",
  54. "query_video_discovery_state",
  55. "register_all_tools",
  56. ]
  57. def register_all_tools(registry: ToolRegistry) -> ToolRegistry:
  58. """将 find_agent 包内的所有工具注册到 ToolRegistry。"""
  59. return registry.from_decorated(*ALL_TOOLS)