Repository navigation
v1.0.51
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
strategyparameter on all extraction functions and conversation methods for manual control when needed - New
prompture test-suiteCLI command runs spec-driven cross-model benchmarks with table or JSON output ProviderEnvironmentlets you pass API keys and endpoints at runtime instead of relying solely on.envfiles- 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— newStructuredOutputStrategyenum (provider_native,tool_call,prompted_repair) withauto_select_strategy()andresolve_strategy()dispatchersprompture/infra/capabilities.py—ProviderCapabilitiesdataclass withbest_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 bothextraction/core.pyandextraction/async_core.pywraps 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 definitionsstrategyparameter threaded throughask_for_json,extract_and_jsonify,extract_with_model,extract_with_models,Conversation.ask_json, andConversation.extract(both sync and async)- Strategy recorded in
usage["strategy"]on all extraction results extract_with_modelsrenamed internalstrategyvariable toextraction_approachto avoid shadowing the new parameter- JSON mode logic refactored:
PROVIDER_NATIVEstrategy auto-enables JSON mode from driver flags;PROMPTED_REPAIRrespects explicitjson_mode="on"but doesn't auto-enable prompture/infra/budget.py—resolve_budget_policy()coerces strings toBudgetPolicyenum with validationbudget_policyparameter type widened toBudgetPolicy | str | NoneacrossAgent,AsyncAgent,Conversation, andAsyncConversationProviderEnvironmentsupport added toAgent,AsyncAgent,Conversation, andAsyncConversationviaenvparameter, forwarded toget_driver_for_model()ConversationandAsyncConversationgainmodel_nameproperty andsystem_promptgetter/setterToolRegistry.from_tukuy_skills()class method for batch skill registrationprompture/drivers/__init__.py—PROVIDER_NAME_MAPdict,parse_model_string(), andprovider_for_model()utilities for model string handlingprompture/cli/cli.py—test-suitecommand with--providers,--models,--format, and-ooptions;_build_drivers()helper for provider instantiationprompture/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, andopenrouter.json;examples/openai_models_comparison.pyupdated prompture/infra/__init__.py— exportsProviderCapabilities,get_capabilities,get_compatibility_matrix,override_capabilities,register_model,register_provider,clear_overrides,resolve_budget_policyprompture/extraction/__init__.py— exportsStructuredOutputStrategy,auto_select_strategy,resolve_strategy- CacaoDocs configuration (
cacao.yaml) and 7 documentation pages added underprompture/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.mddocuments thestrategyparameter addition andextract_with_modelsvariable rename.github/workflows/documentation.ymlupdated for CacaoDocs CI integration