Skip to content

feat: add native OpenAI Decisions provider - #31

Draft
anandpant wants to merge 1 commit into
lm15-dev:mainfrom
anandpant:feat/openai-decisions-upstream
Draft

anandpant wants to merge 1 commit into
lm15-dev:mainfrom
anandpant:feat/openai-decisions-upstream

Conversation

@anandpant

Copy link
Copy Markdown

Summary

Add a native openai-decisions provider for typed judgments at /v1/decisions, with sync/async routing. This is a draft for design review, not a merge-ready contract expansion.

This is a focused port onto upstream 2.4.0 (1ae98203f643059f0c103933c80ab0e7f68c5f26), not an import of DSPy's older 2.2.0 integration branch or its unrelated downstream patches. No runtime dependency is added.

  • Map boolean, choice and ordered judgments to predicate, choice and score questions.
  • Use the Responses input codec for supported text/JSON/images, with explicit admission before encoding.
  • Preserve distributions, refusal evidence and the raw provider envelope; expose a provider-neutral decisions evidence envelope for DSPy.
  • Record harmless sampling controls through MAP-13 note/silent/refuse adaptation policy. Reject unmappable controls, unsupported content, tools and streaming.
  • Keep malformed answers and refusals distinct from negative decisions.

Consumer draft: stanfordnlp/dspy#10870

Verification at 323e1d5

  • 77 targeted provider/adaptation/registry tests passed.
  • Full suite: 3,914 passed, 7 skipped, 1 explicitly deselected live Claude Code test. The first unrestricted run attempted that pre-existing host-auth smoke and received HTTP 429; it was not retried.
  • Strict offline conformance passed all six suites. These are the existing corpus, not new Decisions wire coverage.
  • Type gate: 32 user programs clean; package remains at its existing 390 findings, with zero new findings. Constructor-signature check passed.
  • Pinned contract harness ran: all directions passed except managed discovery, whose closed expected provider list does not yet contain openai-decisions. The contract checkout was not modified to make the new adapter pass. Existing request/response/stream fixture skips remain.

Before ready for merge

  • Land contract-first support, including live-captured request/response receipts, canonical mapping citations, provider discovery and capability/limit rows. Then update CONTRACT_PIN to the accepted contract commit and rerun the pinned harness.
  • Preserve valid billed usage when malformed successful replies fail parsing. This needs the upstream error/usage contract; the downstream solution in Preserve billed usage when OpenAI response parsing fails cmpnd-ai/lm15-python#3 was reviewed, not silently copied into this new provider's public error shape.
  • Reconcile raw-evidence work with Preserve TypeSafe response data #30. This adapter retains the raw OpenAI envelope now; it does not change TypeSafe parsing.

Gemini/OpenRouter Decisions use a different wire codec and provider limits. A separate integration fork exercises them, including PDFs; this PR deliberately does not claim direct Gemini support or inherit OpenAI limits into a Gemini adapter.

Signed-off-by: Anand Pant <anand@shpit.dev>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant