feat(lib): export type_to_response_format_param publicly - #2993
Conversation
Add type_to_response_format_param to the public openai.lib namespace so users don't need to import from internal _parsing._completions path.
|
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. |
7c110b9 to
eb5a6ed
Compare
Castiron custom codeEvaluated main: ✅ No new custom-code files detected. 47 mixed files remain; 0 existing customizations changed. Compared 47 existing customizations unchanged
7 more in the full report. A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload 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.patchOr 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.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
|
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! |
|
@marcuswood-oai Would you consider making the same change to |
Closes #2695
Summary
type_to_response_format_paramfromopenai.libso users can import it without reaching into private modulesCurrently users must import from
openai.lib._parsing._completions, which is an internal path. This adds it to the publicopenai.libnamespace alongside the other publicly exported helpers.Test plan
from openai.lib import type_to_response_format_paramworks