Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat(ai): structured outputs — response_format json_schema for JSON-returning calls where the provider supports it

Aperta
#670 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
java
Ambito
ai

Direzione di ricerca

Start in config/ActiveModelSettings.java to see how per-model flags are declared, then look at the @RegisterAiService request options on PrReviewer, FindingVerifier and PrSummarizer. Add the structured-outputs flag with a default of off and an unchanged prompt path when it is off. Done means a flagged run against a supporting provider produces no salvage activations in tests, and startup rejects the flag on unsupported endpoints.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement java

Split out of #668 so each deliverable can be scheduled and closed independently.

Problem Statement

Every JSON-returning call (review, verifier, summary — and the resolution check once #667 lands) spends significant prompt space specifying output shape: "Respond ONLY with valid JSON…", full schemas, field rules. And because the shape is only requested, malformed output needs the parse-salvage paths and TruncatedResponseSalvager machinery. With the multi-call decomposition (#669) multiplying calls, this boilerplate is paid on every one of them.

Proposed Solution

Where the configured OpenAI-compatible provider supports response_format: json_schema, request it for the JSON-returning calls via LangChain4j request options:

  • Per-model capability flag: thrillhousebot.ai.models.<model>.structured-outputs (default off), following the existing per-model settings pattern in ActiveModelSettings.
  • Prompt-side format instructions shrink to intent only; the schema moves into the request.
  • Graceful degradation: flag off or provider unsupported → current prompt-specified JSON + salvage paths, byte-identical behavior.
  • Truncation salvage stays regardless — finish_reason=length can still cut a schema-valid stream mid-array.

Interacts with #30 (native multi-provider support), which needs the same per-provider capability surface; whichever lands first should establish it.

Touchpoints

config/ThrillhouseConfig.java / config/ActiveModelSettings.java (capability flag), the @RegisterAiService request options for PrReviewer / FindingVerifier / PrSummarizer, review/DiffBudgetPlanner.java (overhead estimation shrinks when format boilerplate leaves the prompts).

Acceptance criteria
  • With the flag on against a supporting provider: zero parse-salvage activations in tests; measured prompt-token reduction on every JSON-returning call.
  • With the flag off or an unsupported provider: behavior unchanged.
  • Startup validation rejects the flag on models where the endpoint reports no support, rather than failing at review time.
Alternatives Considered
  • Keep prompt-specified JSON everywhere — simplest, but the boilerplate and salvage complexity now multiply across the decomposed pipeline.
Lingua principale
Java
Stelle
35
Fork
7
Merge medio
9h 23m
PR unite (30g)
154

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di devops-thiago/ThrillhouseBot

Tutte le issue di devops-thiago/ThrillhouseBot

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.