functualize-ai-pydantic
Status: Published — Independently installable from PyPI.
PydanticAI-backed AI implementation plugin for functualize. Bridges the PydanticAI agent framework and LiteLLM model routing into functualize's AI capability system, providing tool calling, streaming, structured output, multi-turn agent loops, and conversation history continuation — all wired automatically via entry-point discovery.
Installation
pip install functualize-ai-pydantic
Quick Start
Once installed, the plugin registers itself via the functualize.ai_providers entry point. Configure it in your project config:
[ai]
provider = "pydantic"
model = "claude-sonnet-4-20250514"
Then use the AI capability in any functualize job:
from functualize_ai import AI, AIConfig
from functualize_ai_pydantic import PydanticAIProvider
config = AIConfig(model="claude-sonnet-4-20250514", max_tokens=1024)
provider = PydanticAIProvider(config)
result = provider.run("Summarize this document in 3 bullet points.")
print(result.output)
print(f"Tokens used: {result.usage.total_tokens}")
Features
- Tool calling — Translates functualize
ToolDefinstances into PydanticAI's nativeToolformat viaToolScopeTranslator, enabling LLM-driven function invocation - Structured output — Pass a Pydantic model as
response_modelto get typed, validated responses directly from the LLM - Streaming — Iterate over response tokens as they arrive using
PydanticAIProvider.stream() - Multi-turn agent loops —
PydanticAI.run_agent_loop()executes iterative tool-calling workflows with configurable iteration limits - Conversation history —
PydanticAI.run_with_history()continues conversations from prior message history - Auto-registration — Plugin hooks into
APP_READYto resolveAIConfig, create the provider, and register bothAIandPydanticAItypes with DI - Budget tracking — Integrates with functualize's state system for token usage and cost tracking across calls
API Reference
Public classes exported by this plugin:
PydanticAIPlugin— Entry-point plugin class that registers the provider with functualize's DI system at boot. Implements the plugin callable protocol.PydanticAIProvider—AIProviderprotocol implementation backed by PydanticAI and LiteLLM. Methods:complete(),run(),stream(),extract().PydanticAI— ExtendedAIcapability subclass with PydanticAI-specific methods:run_agent_loop()for multi-turn execution andrun_with_history()for conversation continuation.ToolScopeTranslator— Converts a list of functualizeToolDefinstances into PydanticAIToolobjects usingTool.from_schema().
Development
Run plugin tests:
uv run pytest plugins/functualize-ai-pydantic/tests/ -v
Lint and format:
uv run ruff check plugins/functualize-ai-pydantic/
uv run ruff format plugins/functualize-ai-pydantic/
Release files for functualize-ai-pydantic 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| functualize_ai_pydantic-0.1.3.tar.gz | 14.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| functualize_ai_pydantic-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.4 kB
Release files / functualize_ai_pydantic-0.1.3.tar.gz
| Download URL | functualize_ai_pydantic-0.1.3.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
652e80416b0f66fc1c55d1427680c79389b6adc9a804d0477887cce83a6839a2
|
|
BLAKE2b-256 checksum How to use checksums |
c829c25d22fbf8122bc5dc5b3c3f4691539bfdb8995997ec6c376d3ddcc2b992
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / functualize_ai_pydantic-0.1.3-py3-none-any.whl
| Download URL | functualize_ai_pydantic-0.1.3-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b9607710402d9e81cfc9143785c793754b968fdfa982ace59ef4ac330c2d87e
|
|
BLAKE2b-256 checksum How to use checksums |
5cd6b64b672b1e31c3c46c05b2d7e5e3808c265e5c0ccc383511c5b048cecb03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log