Skip to content

Respect default arguments in function tool schemas - #763

Open
shayanxcyber wants to merge 2 commits into
ollama:mainfrom
shayanxcyber:fix/function-tool-defaults
Open

shayanxcyber wants to merge 2 commits into
ollama:mainfrom
shayanxcyber:fix/function-tool-defaults

Conversation

@shayanxcyber

@shayanxcyber shayanxcyber commented Oct 14, 2026 •

Copy link
Copy Markdown

A callable such as def search(query: str, limit: int = 5) currently marks limit as required. Preserve signature defaults, including keyword-only and nullable defaults. Check the missing-default sentinel by identity so default values with custom comparison methods still work.

All 14 utility tests pass with warnings treated as errors, including the custom-comparison regression. Ruff lint/format and the diff check pass.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant