19 lines
582 B
Python
19 lines
582 B
Python
"""Agent result serializers.
|
|
|
|
Pure module: no FastAPI imports and no HTTPException.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def serialize_agent_result(state: dict) -> dict:
|
|
"""Plain dict for services/serializers — no ORM objects."""
|
|
return {
|
|
"suggested_job_post_ids": state.get("suggested_job_post_ids") or [],
|
|
"summary": state.get("summary") or "",
|
|
"reasoning": state.get("reasoning") or "",
|
|
"experience": state.get("experience") or "",
|
|
"status": state.get("status") or "failed",
|
|
"error": state.get("error") or "",
|
|
}
|