mlcommons / mlcommons/endpoints

BFCL/openai: harden msgspec adapter tests + hoist imports + gc docstring for tool_choice

Open
#396 0 comments 0 reactions 1 assignee View on GitHub

@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):

  1. Hoist the in-function imports (ModelParams etc.) to module top per AGENTS.md no-lazy-imports rule.
  2. 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.
  3. 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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.