symfonic.agent.backend.structured_plan¶
structured_plan ¶
Whether this plan may promise a structured answer, checked before it runs.
Split from :mod:symfonic.agent.backend.plan at the 300-line budget. Both
halves answer one question -- can the configured model actually produce the
type the caller asked for -- and the plan factory's remaining methods answer a
different one, which is what makes this a seam rather than a line count.
require_structured_output ¶
Prove the model can bind the schema, before a single token is spent.
hasattr(model, "with_structured_output") is not proof: BaseChatModel
declares the method and raises NotImplementedError from it, so a
presence check passes for every model and the failure lands mid-run โ
exactly the RES-9 failure mode. Actually binding the schema is the real
probe, and it is not a provider call: it builds a runnable locally and
touches no network.
Source code in src/symfonic/agent/backend/structured_plan.py
validate_output_type ¶
Refuse anything that is not a Pydantic model, at construction.