Toolkit Modules Coverage¶
This page documents how source modules are included in the documentation set.
Inclusion strategy¶
The docs use a mixed strategy:
- Full API reference for stable, high-usage modules
- Brief conceptual overview for configuration-heavy or data/prompt-heavy modules
This balance keeps human docs readable while preserving deep API access where it matters.
Requested modules and coverage¶
src/doc_processing_toolkit/data/model_information.json¶
- Coverage type: brief overview
- Overview: Canonical model registry used across the package for provider routing, token/cost pricing lookups, capability flags (tools/thinking/media), and model limits. It is consumed as structured configuration data, not as callable API code.
- Where documented: Providers
src/doc_processing_toolkit/core.py¶
- Coverage type: full API reference
- Overview: Shared token-counting and cost-calculation functions used by provider
call paths and orchestration flows. This module defines core accounting behavior
for input/output/reasoning tokens, prompt-cache reads and writes, tiered pricing,
and built-in tool costs. An agent's
costalso adds the spend its tools report (utils.tool_spend_marker, Cost Tracking). - Where documented: Toolkit Core API
src/doc_processing_toolkit/multimedia.py¶
- Coverage type: full API reference + concept page + recipe
- Overview: One-shot text-to-speech, speech-to-text, and image generation/editing on OpenAI and
Google, validated against the model registry's capability metadata before any API call and priced
through the
audio_output,per_minute, andmultimodal_outputschemas. Speech can also be streamed as it is generated (synthesize_speech_stream/asynthesize_speech_stream, 0.5.1). It also carriesdescribe_media(one media Q&A, modality checked before the upload) andinspect_media(the same questions answered locally, with no network call). - Where documented: Toolkit Core API + Multimedia + Speech, Transcription and Media Questions
src/doc_processing_toolkit/image_session.py¶
- Coverage type: full API reference + concept page + recipe
- Overview:
ImageSession/ImageTurn— multi-turn image generation and editing on OpenAI and Google, with a versioned envelope that survives the process that created it. Re-exported lazily asmultimedia.ImageSession, so reference tooling should point at this module rather than the alias. - Where documented: Toolkit Core API + Image Sessions + Multi-turn Image Sessions
src/doc_processing_toolkit/audio_convert.py¶
- Coverage type: full API reference + concept section
- Overview: Optional speech-to-text container transcoding. It discovers a converter rather than
requiring one, so the
[audio]extra is never a dependency an installing application pays for. - Where documented: Toolkit Core API + Multimedia
src/doc_processing_toolkit/orchestration.py¶
- Coverage type: brief overview
- Overview: Implements higher-order generator/evaluator orchestration workflows (multi-step refinement loops) on top of provider structured-output functions, with loop-level token/cost aggregation and evaluation gating.
- Where documented: this page (primary)
- Status: pre-
Agentpipeline code, deprecation-tracked. Not a public entrypoint — do not build new work on it; use theAgentAPI instead.
src/doc_processing_toolkit/pdf_processor.py¶
- Coverage type: full API reference + recipes
- Overview: End-to-end PDF preprocessing surface for directory traversal, PDF-to-image conversion, image preprocessing, and optional LLM Whisperer extraction workflows. It is a primary entrypoint for document ingestion pipelines.
- Where documented: Toolkit Core API + PDF Processing Pipeline
src/doc_processing_toolkit/prompts.py¶
- Coverage type: brief overview
- Overview: Central prompt template catalog for image extraction, markdown refinement, engineering document reconstruction, and loop-based generation/evaluation flows. This module is primarily content/configuration rather than procedural API logic.
- Where documented: this page (primary)
src/doc_processing_toolkit/realtime.py¶
- Coverage type: full API reference + concept page
- Overview: Provider-neutral realtime sessions over OpenAI Realtime and Gemini Live, wrapping each
vendor SDK's own realtime client behind one connect/configure/send/events lifecycle with
per-modality usage and cost tracked live. Besides speech-to-speech it carries visual input (stills
and rate-gated video frames) and dedicated transcription sessions, routed by
(provider, session_kind). The translation and GPT-Live families live in their own modules below and register themselves into the same routing table. - Where documented: Toolkit Core API + Realtime Voice
src/doc_processing_toolkit/realtime_translation.py¶
- Coverage type: full API reference + concept section
- Overview: Dedicated live-translation sessions — speech in, translated speech and both transcripts
out, with no model turn and no turn-taking.
GeminiLiveTranslateAdapterreuses the Gemini Live socket with atranslation_config;OpenAITranslationAdapteris the module's one documented raw-WebSocket exception, because theopenaiSDK cannot address/v1/realtime/translations. Both register themselves intorealtime's routing table. - Where documented: Toolkit Core API + Realtime Voice
src/doc_processing_toolkit/realtime_gpt_live.py¶
- Coverage type: full API reference + concept section
- Overview: OpenAI's GPT-Live family on its own
/v1/live/*endpoints — a full-duplex voice session with no audio commit, no end-of-response event and no item ids, billed by the second rather than by tokens, whose tools run against a delegated backend. It goes through theopenaiSDK's own Live client and registers itself intorealtime's routing table. - Where documented: Toolkit Core API + Realtime Voice
src/doc_processing_toolkit/schemas.py¶
- Coverage type: full API reference
- Overview: Defines shared Pydantic/dataclass schema objects used for structured output, evaluation workflows, and built-in tool configuration plumbing across providers.
- Where documented: Toolkit Core API
src/doc_processing_toolkit/utils.py¶
- Coverage type: full API reference
- Overview: High-traffic utilities layer for provider client initialization,
validation logic, media/citation handling, model-info helpers, and shared
compatibility transforms used by both Agent and provider modules. It also holds the one retry
layer (the
should_retry_api_callpredicate, theretry-after-aware wait strategy and theDPT_SDK_RETRIESclient setting), the tool-result size cap and the reasoning-into-schema merge switch. Since 0.5.1 it also holds the tool-reported spend marker (tool_spend_marker,read_tool_reported_spend), thetool_call_resultevent fields (tool_result_event_fields,tool_result_data), theTruncatedResultStorebehindread_truncated_result, andIterationEventUsage, which the four tool loops fill foriteration_complete. - Where documented: Toolkit Core API