Skip to main content

A factory type that enables structured output behavior in Pydantic models.

Example usage:

from pydantic_ai import Agent
from pydantic import BaseModel
from pydantic_outputs import structured, StructuredOutput

# structured is a type alias for StructuredOutput
# StructuredOutput(Model) is equivalent to @structured <ModelDef>

@structured
class FooBar(BaseModel):
    foo: str
    bar: int

class BarBaz(BaseModel):
    bar: str
    baz: int

agent = Agent('test')
result = agent.run_sync(
    "Generate a sample object",
    output_type=[FooBar, StructuredOutput(BarBaz)]
)

assert isinstance(result.output, dict)

Metadata

Release files for pydantic-outputs 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-outputs 0.1.2
File Size Uploaded Provenance Actions
pydantic_outputs-0.1.2.tar.gz 2.2 kB Without provenance Details for pydantic_outputs-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-outputs 0.1.2
File Interpreter ABI Platform Actions
pydantic_outputs-0.1.2-py3-none-any.whl Python 3 none any Details for pydantic_outputs-0.1.2-py3-none-any.whl

Total release size: 4.8 kB

Release files / pydantic_outputs-0.1.2.tar.gz

Download URL pydantic_outputs-0.1.2.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
80d4e83aebef35639fab93ecc8711d64fa92dd37a08dc928a14ad4b032ebd2a4
BLAKE2b-256 checksum
How to use checksums
242347c497a0add1f5ed5a259b1afda77108fd56718d00531eee481c96bbeed7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.7

Release files / pydantic_outputs-0.1.2-py3-none-any.whl

Download URL pydantic_outputs-0.1.2-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abb655a00de17bcbcfe2ac2f8db3e604b3265954ae413e0f050380c411c3a330
BLAKE2b-256 checksum
How to use checksums
0289ae3f19687970adffc42ffb5c9a74e102eb3a88bddee7f1f13a42a05fa306
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.7

Security for pydantic-outputs 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page