mlcommons / mlcommons/endpoints
BFCL/openai: harden msgspec adapter tests + hoist imports + gc docstring for tool_choice
Open
@Palanivelg is already working on this.
Since Jul 22, 2026.
- Dominant language
- Python
- Stars
- 21
- Forks
- 28
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 13
Description
Follow-up to PR #346 (thread https://github.com/mlcommons/endpoints/pull/346#discussion_r3532030052).
In tests/unit/openai/test_msgspec_adapter.py and openai/types.py (@viraatc):
- Hoist the in-function imports (
ModelParamsetc.) to module top per AGENTS.md no-lazy-imports rule. - Cover the untested wire-format changes with small encode-and-assert tests:
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. - In
openai/types.py, addtool_choiceto the gc=False AT-RISK mutable-field list in theChatCompletionRequestdocstring (it can hold a dict).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.