from __future__ import annotations

from typing import Annotated

from fastapi import APIRouter, Depends

from v1.agent.dependencies import get_agent_service
from v1.agent.schemas import AgentChatRunRequest, AgentChatRunResponse
from v1.agent.service import AgentChatService

router = APIRouter(prefix="/agent", tags=["agent"])


@router.post("", response_model=AgentChatRunResponse)
async def run_agent_chat(
    payload: AgentChatRunRequest,
    service: Annotated[AgentChatService, Depends(get_agent_service)],
) -> AgentChatRunResponse:
    return await service.run(payload)
