Settings-agnostic Django agent-host substrate for Pydantic-AI: config in, built agent out.
Project description
django-pydantic-agent
The settings-agnostic agent-host substrate shared by Django's Pydantic-AI transports.
It takes an AgentConfig in and returns a built pydantic_ai.Agent — with
composed toolsets, audit, and user resolution — and reads no Django settings
of its own. Each transport owns its settings namespace, builds an AgentConfig,
and hands it down:
- django-ag-ui — AG-UI over SSE for a browser client.
- django-a2a — agent-to-agent (planned).
pip install django-pydantic-agent
Most projects install a transport and get this as a dependency. Reach for it directly when you are building a transport, sharing agent construction between two of them, or embedding an agent with no HTTP surface at all.
from django_pydantic_agent import AgentConfig, ToolRegistry, build_agent, tool
registry = ToolRegistry()
@tool(registry)
def list_orders(status: str) -> list[dict]:
"""List orders with the given status."""
...
agent = build_agent(registry, AgentConfig(model="anthropic:claude-sonnet-4-5"))
What it provides
- Agent construction —
AgentConfig→build_agent, model and provider resolution, and an escape hatch to replace construction entirely. - A tool registry —
@toolwithdestructive/category/confirm/summarymetadata, and JSON Schema derived from the signature. - Storage contracts —
ConversationStore/AttachmentStoreprotocols, reference implementations, and Django models incontrib.store. - Policy — an audit trail over every tool call, and a server-side approval gate for destructive tools. Both off by default.
- Integrations — optional bridges exposing
djangorestframework-servicesspecs or adrf-mcp-serverregistry as agent tools, in process.
Optional extras: [drf-mcp] (bridge a drf-mcp-server registry as a toolset),
[spec-tools] (drf-services specs as agent tools), [harness]
(pydantic-ai-harness capabilities), and the provider extras [anthropic] /
[openai] / [google].
Documentation
https://artui.github.io/django-pydantic-agent/
- Concepts — how a config becomes an agent, and what belongs here versus in a transport.
- Tools — registering tools and what the metadata does.
- Storage — the store contracts, owner scoping, and the reference models.
- Policy — audit and the destructive-tool gate.
- Integrations — DRF specs and MCP tools as agent tools.
- Reference — the full public API.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_pydantic_agent-0.2.0.tar.gz.
File metadata
- Download URL: django_pydantic_agent-0.2.0.tar.gz
- Upload date:
- Size: 229.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0924d062359385c002400c7210cca49140e3d24598111fd031427cbf96240064
|
|
| MD5 |
f2f2bf72f18c14733ceaf872f9cee71c
|
|
| BLAKE2b-256 |
87695b1c3d1be2e6046759e1d8f0dc35d15f83cd557db70a5becf59a76645073
|
Provenance
The following attestation bundles were made for django_pydantic_agent-0.2.0.tar.gz:
Publisher:
release.yml on Artui/django-pydantic-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_pydantic_agent-0.2.0.tar.gz -
Subject digest:
0924d062359385c002400c7210cca49140e3d24598111fd031427cbf96240064 - Sigstore transparency entry: 2257227986
- Sigstore integration time:
-
Permalink:
Artui/django-pydantic-agent@f08e4730a0fff05e6d0d5552192ea19f1d9c102d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Artui
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f08e4730a0fff05e6d0d5552192ea19f1d9c102d -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_pydantic_agent-0.2.0-py3-none-any.whl.
File metadata
- Download URL: django_pydantic_agent-0.2.0-py3-none-any.whl
- Upload date:
- Size: 69.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05d4ec361450af3a24b2aea2543ccf5a4c9e7c7b0fae809fcc1e86bedbc7660d
|
|
| MD5 |
3c25daa2a2b9982904306537094d3aab
|
|
| BLAKE2b-256 |
297cd074181d5e4001011def702e544e8188868749063a06af304570ee51ad95
|
Provenance
The following attestation bundles were made for django_pydantic_agent-0.2.0-py3-none-any.whl:
Publisher:
release.yml on Artui/django-pydantic-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_pydantic_agent-0.2.0-py3-none-any.whl -
Subject digest:
05d4ec361450af3a24b2aea2543ccf5a4c9e7c7b0fae809fcc1e86bedbc7660d - Sigstore transparency entry: 2257227995
- Sigstore integration time:
-
Permalink:
Artui/django-pydantic-agent@f08e4730a0fff05e6d0d5552192ea19f1d9c102d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Artui
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f08e4730a0fff05e6d0d5552192ea19f1d9c102d -
Trigger Event:
push
-
Statement type: