Skip to content

Skip variadic parameters in tool schemas#22164

Open
Kevin-Li-2025 wants to merge 1 commit into
run-llama:mainfrom
Kevin-Li-2025:kevin/skip-variadic-tool-schema
Open

Skip variadic parameters in tool schemas#22164
Kevin-Li-2025 wants to merge 1 commit into
run-llama:mainfrom
Kevin-Li-2025:kevin/skip-variadic-tool-schema

Conversation

@Kevin-Li-2025

Copy link
Copy Markdown

Summary

  • skip *args and **kwargs when deriving tool schemas from function signatures
  • keep regular required/optional parameters unchanged
  • add a regression test so variadic implementation details are not exposed as LLM-fillable fields

Fixes #22134.

Tests

  • uv run --group dev pytest tests/tools/test_utils.py -q
  • uv run --group dev pytest tests/tools/test_base.py::test_function_tool tests/tools/test_base.py::test_tool_fn_schema tests/tools/test_base.py::test_fn_schema_docstring_descriptions -q
  • uv run --group dev ruff check llama_index/core/tools/utils.py tests/tools/test_utils.py

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 27, 2026
@gautamvarmadatla

Copy link
Copy Markdown
Contributor

hi @Kevin-Li-2025 issue author here, please see #22135 it already has the fix :)

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

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tool schema marks **kwargs as a required (untyped) parameter, forcing the LLM to fill it

2 participants