Skip to main content

kiarina-agi-data-builder

What is this?

kiarina-agi-data-builder provides builders for AI agent messages, events, histories, tool info, file info, and file segments.

Dependencies

Required Dependencies

Package Version License
kiarina-agi-audio >=2.9.0 MIT
kiarina-agi-base >=2.7.0 MIT
kiarina-agi-data >=2.7.0 MIT
kiarina-agi-file >=2.8.0 MIT
kiarina-agi-tool >=2.12.0 MIT
kiarina-agi-video >=2.10.0 MIT
kiarina-i18n >=2.3.1 MIT
kiarina-utils-app >=2.4.0 MIT
kiarina-utils-common >=2.8.0 MIT
kiarina-utils-file >=2.3.1 MIT
Pydantic >=2.11.7,<3 MIT
pydantic-settings >=2.10.1,<3 MIT
pydantic-settings-manager >=3.2.0 MIT
PyYAML >=6.0.2 MIT

Optional Dependencies

Package Extras
imageio-ffmpeg file-info-builder-audio
file-info-builder-video
Pillow file-info-builder-image
file-info-builder-pdf
file-info-builder-video
pypdf file-info-builder-pdf
pypdfium2 file-info-builder-pdf
soundfile file-info-builder-audio

The all Extra installs every optional dependency listed above.

Installation

pip install "kiarina-agi-data-builder[all]"

Features

Capability-aware PDF fallback

PDF analysis bundles select content from chat model capabilities.

Capabilities Content
Text only Extracted PDF text
Image Page-numbered page images and extracted PDF text
PDF The original PDF or selected page segment

Set analysis_dpi on the PDF file specification to control the resolution of fallback page images.

from kiarina.agi.file_info_builder_impl.pdf import create_pdf_file_info_builder
from kiarina.agi.run_context import RunContext
from kiarina.utils.file.asyncio import read_file


async def build_pdf_info():
    file_blob = await read_file("/path/to/document.pdf")
    assert file_blob is not None
    builder = create_pdf_file_info_builder(analysis_enabled=True)
    return await builder.build(
        {
            "uri_or_file_path": file_blob.file_path,
            "analysis_dpi": 144,
        },
        file_blob,
        run_context=RunContext(),
    )

Capability-aware video fallback

Video analysis bundles select content from chat model capabilities.

Capabilities Content
Text only Audio transcript and ambient analysis
Image Timestamped video frames, transcript, and ambient analysis
Video Video with its audio track

Set analysis_fps on the video file specification to control the frame rate of the prepared video and fallback images.

from kiarina.agi.file_info_builder_impl.video import (
    create_video_file_info_builder,
)
from kiarina.agi.run_context import RunContext
from kiarina.utils.file.asyncio import read_file


async def build_video_info():
    file_blob = await read_file("/path/to/video.mp4")
    assert file_blob is not None
    builder = create_video_file_info_builder(
        analysis_enabled=True,
        audio_consumers=["stt", "ambient"],
    )
    return await builder.build(
        {
            "uri_or_file_path": file_blob.file_path,
            "analysis_fps": 1.0,
        },
        file_blob,
        run_context=RunContext(),
    )

API Reference

kiarina.agi.file_info_builder_impl.pdf

from kiarina.agi.file_info_builder_impl.pdf import (
    PDFFileInfoBuilder,
    PDFFileInfoBuilderSettings,
    create_pdf_file_info_builder,
    settings_manager,
)

create_pdf_file_info_builder

def create_pdf_file_info_builder(**kwargs: Any) -> PDFFileInfoBuilder: ...

Creates a PDF file info builder from managed settings and optional overrides.

PDFFileInfoBuilder

class PDFFileInfoBuilder(BaseFileInfoBuilder):
    def __init__(self, settings: PDFFileInfoBuilderSettings) -> None: ...

    async def build(
        self,
        file_info_spec: FileInfoSpec,
        file_blob: FileBlob,
        *,
        run_context: RunContext,
    ) -> BuildResult: ...

PDFFileInfoBuilderSettings

class PDFFileInfoBuilderSettings(BaseSettings):
    analysis_enabled: bool = False

settings_manager is the SettingsManager[PDFFileInfoBuilderSettings] instance used by the factory.

kiarina.agi.file_info_builder_impl.video

from kiarina.agi.file_info_builder_impl.video import (
    VideoFileInfoBuilder,
    VideoFileInfoBuilderSettings,
    create_video_file_info_builder,
    settings_manager,
)

create_video_file_info_builder

def create_video_file_info_builder(**kwargs: Any) -> VideoFileInfoBuilder: ...

Creates a video file info builder from managed settings and optional overrides.

VideoFileInfoBuilder

class VideoFileInfoBuilder(BaseFileInfoBuilder):
    def __init__(self, settings: VideoFileInfoBuilderSettings) -> None: ...

    async def build(
        self,
        file_info_spec: FileInfoSpec,
        file_blob: FileBlob,
        *,
        run_context: RunContext,
    ) -> BuildResult: ...

VideoFileInfoBuilderSettings

class VideoFileInfoBuilderSettings(BaseSettings):
    analysis_enabled: bool = False
    audio_source: AudioSourceSpecifier = "file?sample_rate=16000&start_timestamp=0.0"
    audio_consumers: list[AudioConsumerSpecifier] = [
        "stt?diarization_enabled=true",
        "ambient?window_seconds=10.0&top_k=3",
    ]
    audio_event_bundlers: list[AudioEventBundlerSpecifier] = ["stt", "ambient"]

settings_manager is the SettingsManager[VideoFileInfoBuilderSettings] instance used by the factory.

Metadata

Release files for kiarina-agi-data-builder 2.32.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 kiarina-agi-data-builder 2.32.0
File Size Uploaded
kiarina_agi_data_builder-2.32.0.tar.gz 66.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kiarina-agi-data-builder 2.32.0
File Interpreter ABI Platform
kiarina_agi_data_builder-2.32.0-py3-none-any.whl Python 3 none any Details

Total release size: 167.5 kB

Release files / kiarina_agi_data_builder-2.32.0.tar.gz

Download URL kiarina_agi_data_builder-2.32.0.tar.gz
Size 66.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0c499993ceafa5a6f605dc437ba98350df1c31384126ad12f87ec4cd1e13ea16
BLAKE2b-256 checksum
How to use checksums
42ccc629ab9c0ee5f0580b87b2365e124b43ad00a1351335c258f8c806aceeda
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 20, 2026.

Transparency log

Release files / kiarina_agi_data_builder-2.32.0-py3-none-any.whl

Download URL kiarina_agi_data_builder-2.32.0-py3-none-any.whl
Size 101.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f824ea582b5d38da09d7607f082f76c18a655c9ba2833f446899f5f75fc7c86a
BLAKE2b-256 checksum
How to use checksums
abc00ad0645c3e06e1cde21bcb27ce60cf46525d53c8a93cdfaf8e1719079bf2
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 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.32.0 This release

2 release files

2.21.1

2 release files

2.19.0

2 release files

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