"""
demand_video_expand_agent 工厂 — 组装需求视频点位拓展判断 Agent。
"""
from __future__ import annotations

from pathlib import Path

from supply_agent import Agent
from supply_agent.config import Settings
from agents.demand_video_expand_agent.tools import register_all_tools

_PROMPT_PATH = Path(__file__).parent / "prompt" / "system_prompt.md"
DEMAND_VIDEO_EXPAND_AGENT_SYSTEM_PROMPT = _PROMPT_PATH.read_text(encoding="utf-8")


def create_demand_video_expand_agent(
    settings: Settings | None = None,
    *,
    model: str | None = None,
) -> Agent:
    """创建 demand_video_expand_agent 实例，注册专属工具。"""
    agent = Agent(
        settings=settings,
        name="demand_video_expand_agent",
        model=model,
        system_prompt=DEMAND_VIDEO_EXPAND_AGENT_SYSTEM_PROMPT,
        max_iterations=10,
    )
    register_all_tools(agent.tools)
    return agent
