Structured output with auto-retry
Pass a Pydantic model or JSON Schema. Get a typed result. On parse failure, the runtime retries inside the same conversation — no separate fixing LLM.
LangChain's OutputFixingParser runs a fresh LLM call. Ours stays in the same conversation, so the model has full context of what it tried.
from pydantic import BaseModelfrom shipit_agent import Agentclass Movie(BaseModel):title: strrating: floatresult = agent.run("Recommend a thriller.",output_schema=Movie,max_validation_retries=2,)print(result.parsed) # Movie(title='Heat', rating=8.5)