Skip to content

feat(lib): export type_to_response_format_param publicly - #2993

Merged
marcuswood-oai merged 4 commits into
openai:mainfrom
Bortlesboat:export-response-format-param
Oct 2, 2026
Merged

marcuswood-oai merged 4 commits into
openai:mainfrom
Bortlesboat:export-response-format-param

Conversation

@Bortlesboat

Copy link
Copy Markdown
Contributor

Closes #2695

Summary

  • Exports type_to_response_format_param from openai.lib so users can import it without reaching into private modules

Currently users must import from openai.lib._parsing._completions, which is an internal path. This adds it to the public openai.lib namespace alongside the other publicly exported helpers.

Test plan

  • Verified from openai.lib import type_to_response_format_param works
  • No behavior change — just a re-export

@Bortlesboat
Bortlesboat requested a review from a team as a code owner March 20, 2026 02:21
Add type_to_response_format_param to the public openai.lib namespace
so users don't need to import from internal _parsing._completions path.
@Bortlesboat

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and added a regression covering the public namespace export. The focused test passes, and Ruff plus formatting checks pass for the touched files.

@Bortlesboat
Bortlesboat force-pushed the export-response-format-param branch from 7c110b9 to eb5a6ed Compare July 12, 2026 22:44
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: b6ca5b5346b45ff5ea5ffb2fa4eaa2efa0d2c537.

✅ No new custom-code files detected.

47 mixed files remain; 0 existing customizations changed.

Compared b6ca5b5346b4 → 9b343c8a0c33. Generated baselines verified.

47 existing customizations unchanged
  • api.md
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/agents/environments/files.py
  • src/openai/resources/beta/agents/sessions/artifacts.py
  • src/openai/resources/beta/agents/sessions/sessions.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/responses/responses.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/live/forks.py
  • src/openai/resources/live/live.py
  • src/openai/resources/live/sideband.py
  • src/openai/resources/realtime/api.md
  • src/openai/resources/realtime/realtime.py
  • src/openai/resources/responses/responses.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/beta/agent_session_message.py
  • src/openai/types/beta/session_turn_error.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/realtime/conversation_item_input_audio_transcription_delta_event.py
  • src/openai/types/realtime/realtime_error_event.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py

7 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 37056521435 --repo openai/openai-python \
  --name castiron-custom-code-37056521435-1 --dir /tmp/castiron-custom-code-37056521435-1
git apply --stat /tmp/castiron-custom-code-37056521435-1/custom-code.patch
cat /tmp/castiron-custom-code-37056521435-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin b6ca5b5346b45ff5ea5ffb2fa4eaa2efa0d2c537 9b343c8a0c33c9fe584e30f54b0c45e3ef9b0050
python3 scripts/castiron/custom_code_report.py report \
  --base b6ca5b5346b45ff5ea5ffb2fa4eaa2efa0d2c537 \
  --head 9b343c8a0c33c9fe584e30f54b0c45e3ef9b0050 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-9b343c8a0c33
cat /tmp/castiron-custom-code-9b343c8a0c33/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@marcuswood-oai
marcuswood-oai added this pull request to the merge queue Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks, Andrew! This makes the helper much easier to use without reaching into private modules. I’ve merged in main and checked it with both supported Pydantic versions. Nice, small addition—thanks for putting it together!

Merged via the queue into openai:main with commit becc1d2 Oct 2, 2026
16 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Oct 2, 2026
@s-banach

s-banach commented Oct 2, 2026

Copy link
Copy Markdown

@marcuswood-oai Would you consider making the same change to type_to_text_format_param, which builds the text.format parameter for the Responses API?

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.

Include type_to_response_format_param in public API

3 participants