Follow-up to PR #346 (thread #346 (comment)).
In tests/unit/openai/test_msgspec_adapter.py and openai/types.py (@viraatc):
- Hoist the in-function imports (
ModelParams etc.) to module top per AGENTS.md no-lazy-imports rule.
- Cover the untested wire-format changes with small encode-and-assert tests:
stream is now omitted when streaming is off (previously "stream": false), tool_choice encoding has no test, and nothing pins that seed=None is omitted from the encoded payload per omit_defaults.
- In
openai/types.py, add tool_choice to the gc=False AT-RISK mutable-field list in the ChatCompletionRequest docstring (it can hold a dict).
Follow-up to PR #346 (thread #346 (comment)).
In
tests/unit/openai/test_msgspec_adapter.pyandopenai/types.py(@viraatc):ModelParamsetc.) to module top per AGENTS.md no-lazy-imports rule.streamis now omitted when streaming is off (previously"stream": false),tool_choiceencoding has no test, and nothing pins thatseed=Noneis omitted from the encoded payload peromit_defaults.openai/types.py, addtool_choiceto the gc=False AT-RISK mutable-field list in theChatCompletionRequestdocstring (it can hold a dict).