Skip to content

Cleanup/tool schema 1848 - #1946

Open
ShashwatXD wants to merge 3 commits into
kyegomez:masterfrom
ShashwatXD:cleanup/tool-schema-1848
Open

Cleanup/tool schema 1848#1946
ShashwatXD wants to merge 3 commits into
kyegomez:masterfrom
ShashwatXD:cleanup/tool-schema-1848

Conversation

@ShashwatXD

Copy link
Copy Markdown

Problem

base_model_to_openai_function emitted the legacy {"function_call", "functions"} envelope, and base_model_to_dict immediately unpacked functions[0] and rewrapped it as {"type": "function", "function": ...}. Same peel happened again in multi_base_model_to_openai_function.

Changes

  • base_model_to_openai_function now returns {"type": "function", "function": {"name", "description", "parameters"}} directly
  • base_model_to_dict is a thin wrapper around that (validation only)
  • multi_base_model_to_openai_function returns a list of those schemas (was a {function_call, functions} dict — no in-tree callers)
  • remove dead *args/**kwargs from base_model_to_dict (forwarding always raised; B026)

Tests

  • updated name assertion for the modern shape
  • added test_no_legacy_envelope_round_trip (both paths return the same dict, no envelope keys)
  • updated test_base_model_to_dict for the modern shape

Closes #1848

@ShashwatXD
ShashwatXD requested a review from kyegomez as a code owner August 20, 2026 19:52
@github-actions

Copy link
Copy Markdown

Hello there, thank you for opening an PR ! 🙏🏻 The team was notified and they will get back to you asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant