Skip to main content

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 ToolDef instances into PydanticAI's native Tool format via ToolScopeTranslator, enabling LLM-driven function invocation
  • Structured output — Pass a Pydantic model as response_model to 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_READY to resolve AIConfig, create the provider, and register both AI and PydanticAI types 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 — AIProvider protocol implementation backed by PydanticAI and LiteLLM. Methods: complete(), run(), stream(), extract().
  • PydanticAI — Extended AI capability subclass with PydanticAI-specific methods: run_agent_loop() for multi-turn execution and run_with_history() for conversation continuation.
  • ToolScopeTranslator — Converts a list of functualize ToolDef instances into PydanticAI Tool objects using Tool.from_schema().

Development

Run plugin tests:

uv run pytest plugins/domains/functualize-ai-pydantic/tests/ -v

Lint and format:

uv run ruff check plugins/domains/functualize-ai-pydantic/
uv run ruff format plugins/domains/functualize-ai-pydantic/

Release files for functualize-ai-pydantic 0.4.0

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

Source distribution (sdist)

Source distribution for functualize-ai-pydantic 0.4.0
File Size Uploaded
functualize_ai_pydantic-0.4.0.tar.gz 19.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for functualize-ai-pydantic 0.4.0
File Interpreter ABI Platform
functualize_ai_pydantic-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.5 kB

Release files / functualize_ai_pydantic-0.4.0.tar.gz

Download URL functualize_ai_pydantic-0.4.0.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8326dfc8b3a4b62fe345eb27bb6a67a4de5bad91859d406367382c99e7a1c387
BLAKE2b-256 checksum
How to use checksums
373cd97a12ad368d685711bea145e39fe40204adcfb83390111391ef9d86ef82
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 25, 2026.

Transparency log

Release files / functualize_ai_pydantic-0.4.0-py3-none-any.whl

Download URL functualize_ai_pydantic-0.4.0-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e61bb526498699fc68854536dff7940abf96149ef06821889b8ae0bb1c095141
BLAKE2b-256 checksum
How to use checksums
8e028146038866b74bf07c1288aad9757292003b684518bdea2ac8c839a0f9ba
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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