23 lines
661 B
Python
23 lines
661 B
Python
"""Agent entrypoint — run the compiled graph.
|
|
|
|
Pure module: no FastAPI imports and no HTTPException.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from agent.agent_setup import get_graph
|
|
from agent.serializers import serialize_agent_result
|
|
|
|
|
|
async def run_agent(*, subject="", resume_text="", job_posts=None) -> dict:
|
|
"""Run the default graph and return a serialized result dict."""
|
|
final_state = await get_graph().ainvoke(
|
|
{
|
|
"subject": subject or "",
|
|
"resume_text": resume_text or "",
|
|
"job_posts": job_posts or [],
|
|
"status": "pending",
|
|
}
|
|
)
|
|
return serialize_agent_result(final_state)
|