Add OpenAI Responses adapter, provider_options, and response.schema mapping#9
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab48cbbeb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| history: options.history, | ||
| toolRegistry: options.toolRegistry, | ||
| strict: options.strict, | ||
| openaiResponses: options.openaiResponses, |
There was a problem hiding this comment.
Pass OpenAI Responses runtime options into provider validation
renderPrompt() now forwards openaiResponses only when calling adapter.render, but provider validation is still run earlier without runtime options. That means the new mutual-exclusion guard for conversation + previous_response_id in openai-responses never executes on the main API path, so invalid combinations are emitted into request bodies and fail at the provider API instead of being caught locally.
Useful? React with 👍 / 👎.
Motivation
provider_options) to surface advanced options for Anthropic and Gemini while keeping normalized front matter.response.schemafield and map it to provider-specific fields.Description
openaiResponsesAdapterinsrc/providers/openai-responses.tsand registers it insrc/providers/index.tsand exports insrc/index.ts.openaiResponsesoptions andOpenAIResponsesRuntimeOptionstosrc/providers/types.ts, and exposesopenaiResponsesonRenderPromptOptionsinsrc/index.ts.src/schema/schema.ts) withresponse.schema,schema_name,schema_strict, and a newprovider_optionsstructure includinganthropicandgeminioption shapes and allowsopenai-responsesin provider enums and defaults.response.schemato provider-specific fields: OpenAI/OpenRouter useresponse_format.json_schema, Responses API maps totext.format.json_schema, and Gemini maps togenerationConfig.responseSchema; also add warnings and behavior notes (e.g. Gemini streaming is endpoint-based).provider_optionsinapply-overrides.tsand maps provider-specific options into request bodies insrc/providers/anthropic.tsandsrc/providers/gemini.ts.README.md,docs/api-reference.md,docs/providers.md) to document the new adapter, runtime options, provider options, and streaming nuances.providers/openai-responsesintsup.config.tsandpackage.json.tests/providers.test.tsto coveropenai-responses,response.schemamapping,provider_optionsbehavior, Gemini streaming warning, and provider naming.Testing
npm test(runsvitest run), which exercises the newopenai-responsesadapter,response.schemamappings, andprovider_options; tests passed.tests/providers.test.ts, and they succeeded.tsupconfig by running the librarybuildscript as part of CI (tsup), which completed successfully.Codex Task