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/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.3.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.3.0
File Size Uploaded
functualize_ai_pydantic-0.3.0.tar.gz 18.8 kB Details

Built distribution (wheel)

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

Total release size: 37.6 kB

Release files / functualize_ai_pydantic-0.3.0.tar.gz

Download URL functualize_ai_pydantic-0.3.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
77233b9bc4c857cdc08e088612ed4e8c6ad4936db6e3c2ccea5e8c43dbcfd782
BLAKE2b-256 checksum
How to use checksums
34c3635b662c32891872eaf92b7b820f5d89b877513834ae5347e02fccdcc3c9
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 18, 2026.

Transparency log

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

Download URL functualize_ai_pydantic-0.3.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d6a0bc73315e6ba78ac97c6cb705bfceb5acde534844edaba78bd8037431f3f
BLAKE2b-256 checksum
How to use checksums
ab8e839f35e360b89920770a33269212216c4da280bcd8da6bb769b7ae83f2d5
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 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.0 This release

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