Skip to content

v1.0.51

Choose a tag to compare

@github-actions github-actions released this 13 Mar 00:54
8553f27

Changes

Prompture's extraction layer used to have one trick: prompt the model and hope for valid JSON. Now it reads the room. A three-tier strategy system — provider-native JSON mode, tool-call extraction, and prompted repair — automatically picks the best approach based on what each driver actually supports, so you stop paying for retries on models that could've gotten it right the first time.

This release also ships a test-suite CLI for cross-model comparison, a ProviderEnvironment for runtime credential injection, string-based budget policy resolution, and GPT-5.4 pricing across OpenAI/Azure/OpenRouter rate files.

Highlights

  • Extraction calls now auto-select the best structured output strategy per model — native JSON mode, function-calling, or prompted repair — with zero configuration
  • Explicit strategy parameter on all extraction functions and conversation methods for manual control when needed
  • New prompture test-suite CLI command runs spec-driven cross-model benchmarks with table or JSON output
  • ProviderEnvironment lets you pass API keys and endpoints at runtime instead of relying solely on .env files
  • Budget policies now accept plain strings ("hard_stop", "warn", "degrade") alongside the enum
  • GPT-5.4 model support across OpenAI, Azure, and OpenRouter providers
Technical changes
  • prompture/extraction/strategy.py — new StructuredOutputStrategy enum (provider_native, tool_call, prompted_repair) with auto_select_strategy() and resolve_strategy() dispatchers
  • prompture/infra/capabilities.py — ProviderCapabilities dataclass with best_strategy() resolution, thread-safe provider/model registry, get_capabilities() auto-populates from driver class flags, get_compatibility_matrix() for introspection, override_capabilities() for custom setups
  • _extract_via_tool_call() in both extraction/core.py and extraction/async_core.py wraps JSON schema as an OpenAI-compatible tool definition and extracts structured data from tool call arguments
  • _schema_to_tool() helper converts JSON schemas into function-calling tool definitions
  • strategy parameter threaded through ask_for_json, extract_and_jsonify, extract_with_model, extract_with_models, Conversation.ask_json, and Conversation.extract (both sync and async)
  • Strategy recorded in usage["strategy"] on all extraction results
  • extract_with_models renamed internal strategy variable to extraction_approach to avoid shadowing the new parameter
  • JSON mode logic refactored: PROVIDER_NATIVE strategy auto-enables JSON mode from driver flags; PROMPTED_REPAIR respects explicit json_mode="on" but doesn't auto-enable
  • prompture/infra/budget.py — resolve_budget_policy() coerces strings to BudgetPolicy enum with validation
  • budget_policy parameter type widened to BudgetPolicy | str | None across Agent, AsyncAgent, Conversation, and AsyncConversation
  • ProviderEnvironment support added to Agent, AsyncAgent, Conversation, and AsyncConversation via env parameter, forwarded to get_driver_for_model()
  • Conversation and AsyncConversation gain model_name property and system_prompt getter/setter
  • ToolRegistry.from_tukuy_skills() class method for batch skill registration
  • prompture/drivers/__init__.py — PROVIDER_NAME_MAP dict, parse_model_string(), and provider_for_model() utilities for model string handling
  • prompture/cli/cli.py — test-suite command with --providers, --models, --format, and -o options; _build_drivers() helper for provider instantiation
  • prompture/cli/formatters.py — format_table() renders test suite reports as aligned summary tables grouped by test ID
  • GPT-5.4 pricing added to prompture/infra/rates/openai.json, azure.json, and openrouter.json; examples/openai_models_comparison.py updated
  • prompture/infra/__init__.py — exports ProviderCapabilities, get_capabilities, get_compatibility_matrix, override_capabilities, register_model, register_provider, clear_overrides, resolve_budget_policy
  • prompture/extraction/__init__.py — exports StructuredOutputStrategy, auto_select_strategy, resolve_strategy
  • CacaoDocs configuration (cacao.yaml) and 7 documentation pages added under prompture/pages/
  • GitHub issue templates for pricing mismatches, driver bugs, and schema extraction failures
  • Sphinx docs: compatibility matrix, migration guide, stability guarantees, test harness, and "why Prompture" pages
  • Test spec files added: specs/basic_extraction.json, specs/schema_validation.json, specs/strategy_comparison.json
  • BREAKING_CHANGES.md documents the strategy parameter addition and extract_with_models variable rename
  • .github/workflows/documentation.yml updated for CacaoDocs CI integration

Details