Add an OpenAI Responses API adapter

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
ai, api

Direzione di ricerca

Start with the existing normalized provider event stream and SSE accumulator, and with how the model profile selects a provider today; the new dialect = "responses" option has to plug in there. Read the Responses API reference and the Chat Completions path side by side, then decide how input items, tool-call ids and reasoning items map onto the internal types. Done means the acceptance checklist passes against a Responses fixture, with lh doctor showing the selected adapter.

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

Descrizione

area: providers enhancement priority: P2

Problem

The provider speaks Chat Completions only. The Responses API is a different shape: typed input/output items, function_call and function_call_output items, opaque reasoning items that must be passed back with tool results, and typed streaming events. Some gateways and newer local servers expose Responses; a Chat-Completions-only client cannot use them correctly.

Sending a Responses request through the Chat Completions path silently drops fields the provider requires.

Inspiration

  • OpenAI Responses API reference.
  • Codex CLI, which uses the Responses protocol.
  • The existing normalized provider event stream and SSE accumulator.

Proposal

Add dialect = "responses" to the model profile and a second adapter behind the same internal event stream:

  • Map internal messages to input items and back; preserve opaque reasoning items byte-for-byte.
  • Map function_call / function_call_output to the existing tool-call ledger and ids.
  • Parse typed streaming events (response.output_text.delta, response.function_call_arguments.delta, response.completed) into StreamEvent.
  • Map usage, finish reasons and errors into the existing types.
  • Keep store = false by default; never send a conversation to a remote store implicitly.
  • Fail closed with a capability error when a required item cannot be represented, rather than dropping it.

Acceptance criteria

  • A text turn and a tool turn work against a Responses fixture.
  • Opaque reasoning items round-trip unchanged.
  • Streamed function-call arguments assemble exactly like Chat Completions.
  • store = false is always sent unless explicitly configured otherwise.
  • An unsupported item produces a typed error before the request.
  • The adapter is selected by profile and shown in lh doctor.
Lingua principale
Rust
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 GotinhaAzul/LocalHarness

Tutte le issue di GotinhaAzul/LocalHarness

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.