Repository navigation
v1.13.10
Changes
Merges everything on dev into main: driver fixes, per-call API keys, and three new features (brand context for marketing work, assistants defined in files, and a tested feedback loop).
Drivers and extraction
- Claude on the 5.x models. Fable 5.1, Mythos 5.1, Opus 5.5 and Sonnet 5.5 reject a forced
tool_choice, so every JSON-mode call to them returned a 400. They now get structured output (output_config.format) instead. The driver no longer sendstemperatureto those families, and theeffortoption reachesoutput_config.effort. ANTHROPIC_API_KEYnow works as a fallback whenCLAUDE_API_KEYis unset.- Per-call
api_key.extract_with_modelandextract_and_jsonifyaccept one, so an app can use each user's own key. - Null metrics no longer fail a generation. Debug logs formatted meta values with
%d/%f, and a provider reportingnullraisedTypeErrorout of a rotating file handler.
New: prompture.marketing
BrandContextholds the customer, pains and objections, core messaging, offers, voice and banned words, verified proof and testimonials, contact details and brand colors.- It loads from YAML, JSON or a fill-in Markdown file (
BrandContext.save_markdown_template()writes the blank one). - Pass it as
brand=toAgent,AsyncAgent,Assistantandextract_with_model. It goes into the system prompt with rules against inventing numbers, testimonials or contact details.
- It loads from YAML, JSON or a fill-in Markdown file (
ClaimsCheckerflags URLs, emails and phone numbers the brand doesn't list, plus banned words. With a model, it also checks each factual claim against the proof points throughFaithfulnessEvaluator.- Output models whose limits are validators, so extraction retries on the exact rule that broke:
SocialPostSet,ShotList/VideoClip,EmailSequence,CoreMessaging,IdealCustomer,TopTens,LeadMagnetIdeas,OfferStack,ScorecardAnalysis.- Example limits: 5-word image hook, no text in image prompts, voiceover sized to the clip length, email send days in order.
marketing.generate()/agenerate()create any of those models for a task, with the brand applied.analyze_metric()does the scorecard arithmetic without a model.
New: Assistant.from_file()
Loads an assistant from YAML, JSON or Markdown (front matter plus body). A file can set instructions, knowledge documents (inlined, with PDF/DOCX through ingestion and a 200k-character cap), conversation starters, named tools, skills and a brand. with_instructions() swaps in a new version of the instructions.
New: FeedbackLoop (prompture.execution.improve)
FeedbackLogrecords user corrections. They are summarized into rules in a## Feedback rulessection, without touching the rest of the instructions.- Old and new instructions are scored with an
LLMJudgewhose rubric includes every rule. - The change is promoted through
PromotionLedgeronly if it gains at least 0.01 on held-out prompts.rollback()restores the previous version.
Tests
- 67 new tests cover the three features. All model calls are stubbed.
tests/test_reasoning.py: three driver stubs now accept theapi_keykeyword. Without this, thedevrun on97bcbb9failed.- Locally:
ruff check .andbandit -r prompture/pass, and pytest gives 5,364 passed, 89 skipped.