← Changelog
New featureImprovement
v0.5.0: AgentConfig and structured agent outputs
Orchflow v0.5.0 adds typed AgentConfig provider settings and an Agent.run_structured method for JSON schema and Pydantic-validated outputs.
- Structured agent outputs:
Agent.run_structured(prompt, schema=...)returns parsed JSON for JSON schema dictionaries, or a validated instance when a Pydantic model class is passed. Pydantic remains optional and is not a core Orchflow dependency. - Typed provider configuration: new
AgentConfigdataclass carriesmodel,temperature,max_tokens,api_base,api_key,timeout, and anextradict for provider-specific kwargs. Pass it viaAgent(config=AgentConfig(...)); existing direct fields onAgentstill work and take priority if both are set.
agent = Agent(
name="extractor",
role="Extract structured data.",
config=AgentConfig(model="openai/gpt-5-mini", temperature=0),
)
parsed = await agent.run_structured(prompt, schema={"type": "object", ...})
- New error type:
StructuredOutputErroris raised for invalid JSON, schema/validation failures, unsupported schema types, or empty model output fromrun_structured(...). - New example:
examples/structured_agent.pydemonstrates a JSON-schema extraction flow usingAgentConfigandrun_structured(...)inside aFlowstep. - Docs and roadmap refresh: quickstart, API reference, concepts, and
AGENTS.mdnow documentAgentConfigand structured outputs; roadmap adds a0.6.0target to evaluate one-turn tool execution. - Clarified tool-calling error: calling an
Agentconfigured withtoolsnow raisesNotImplementedErrormentioning "outside Orchflow v0.5" (previously referenced v0.1), pointing users to call tools inside normal steps.