SIGN IN SIGN UP

fix: ๐Ÿ› ๏ธ make `tool_choice` capability-aware (#115)

* fix: ๐Ÿ› ๏ธ make `tool_choice` capability-aware

**๐Ÿ› Fixes**
- [Bug]: tool_choice parameter not supported on GPT-5.6 Azure models Fixes #114
- Omit `tool_choice` when LiteLLM metadata does not list it in `supported_openai_params`, preventing unsupported-parameter rejections on Azure GPT-5.6 and similar deployments.
- Keep `tool_choice: "auto"` only for models that explicitly support it, while preserving the previous compatibility behavior when capability metadata is missing.

**๐Ÿงช Tests**
- Add regression coverage for parameter support checks, request construction, unsupported-parameter stripping, and `convertTools` auto-mode behavior.

**๐Ÿ“š Docs**
- Update the changelog and README copy to document the 2.1.9 tool-calling compatibility fix.

**๐Ÿงน Chores**
- Bump the package version to 2.1.9 and refresh `@types/node`.

Fixes #114

* test: make MockLiteLLM tool-call tests deterministic ๐Ÿงช

**๐Ÿงช Tests**
- Add an injectable `random` option to `MockLiteLLMBackend` so tool-call selection can be controlled in tests.
- Use a fixed high random value in tool-call integration tests to reliably trigger tool-call responses and remove flaky probabilistic assertions.
A
amwdrizz committed
2620c2f6d3ca14130b0d7349401f55f7389df773
Parent: caa7784
Committed by GitHub <noreply@github.com> on 7/9/2026, 9:57:30 PM