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.2.1

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.2.1
File Size Uploaded
functualize_ai_pydantic-0.2.1.tar.gz 14.2 kB Details

Built distribution (wheel)

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

Total release size: 28.4 kB

Release files / functualize_ai_pydantic-0.2.1.tar.gz

Download URL functualize_ai_pydantic-0.2.1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e4fee48ffb8a3f61c44f8d978b4aab784fd4aea63f1175f28f05f15489c11c6e
BLAKE2b-256 checksum
How to use checksums
7afd56bf7881f75c3dcc24cbfb901f43d79680d03badefbf84e83afa5f712667
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 4, 2026.

Transparency log

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

Download URL functualize_ai_pydantic-0.2.1-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2872302172c71430f026a1efefc749eb38bec895360b6d16eb028b86099af737
BLAKE2b-256 checksum
How to use checksums
c7876958f41004075ca2cfb9431e3f4b59a244f4b6e5161c71ac1e1ec73d87d1
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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

This release

0.2.1 This release

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