__init__.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. audit_video_discovery_run,
  22. batch_save_video_candidate_evaluations,
  23. create_video_discovery_run,
  24. query_video_discovery_state,
  25. record_video_search_page,
  26. )
  27. from supply_agent.tools.registry import ToolRegistry
  28. ALL_TOOLS: list[Callable[..., Any]] = [
  29. douyin_search,
  30. douyin_search_tikhub,
  31. douyin_user_videos,
  32. douyin_detail,
  33. get_content_fans_portrait,
  34. get_account_fans_portrait,
  35. batch_fetch_portraits,
  36. normalize_age_portraits,
  37. create_video_discovery_run,
  38. record_video_search_page,
  39. batch_save_video_candidate_evaluations,
  40. audit_video_discovery_run,
  41. query_video_discovery_state,
  42. ]
  43. __all__ = [
  44. "ALL_TOOLS",
  45. "douyin_search",
  46. "douyin_search_tikhub",
  47. "douyin_user_videos",
  48. "douyin_detail",
  49. "get_content_fans_portrait",
  50. "get_account_fans_portrait",
  51. "batch_fetch_portraits",
  52. "normalize_age_portraits",
  53. "create_video_discovery_run",
  54. "record_video_search_page",
  55. "batch_save_video_candidate_evaluations",
  56. "audit_video_discovery_run",
  57. "query_video_discovery_state",
  58. "register_all_tools",
  59. ]
  60. def register_all_tools(registry: ToolRegistry) -> ToolRegistry:
  61. """将 find_agent 包内的所有工具注册到 ToolRegistry。"""
  62. return registry.from_decorated(*ALL_TOOLS)