← 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 AgentConfig dataclass carries model, temperature, max_tokens, api_base, api_key, timeout, and an extra dict for provider-specific kwargs. Pass it via Agent(config=AgentConfig(...)); existing direct fields on Agent still 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: StructuredOutputError is raised for invalid JSON, schema/validation failures, unsupported schema types, or empty model output from run_structured(...).
  • New example: examples/structured_agent.py demonstrates a JSON-schema extraction flow using AgentConfig and run_structured(...) inside a Flow step.
  • Docs and roadmap refresh: quickstart, API reference, concepts, and AGENTS.md now document AgentConfig and structured outputs; roadmap adds a 0.6.0 target to evaluate one-turn tool execution.
  • Clarified tool-calling error: calling an Agent configured with tools now raises NotImplementedError mentioning "outside Orchflow v0.5" (previously referenced v0.1), pointing users to call tools inside normal steps.

© Primitive SDKs

Powered by Browzer