Support user-configurable parameter override for model completion parameters by albertvillanova · Pull Request #1678 · huggingface/smolagents (original) (raw)

Support user-configurable parameter override for model completion parameters.

This PR gives self.kwargs highest priority over method parameters and explicitly passed kwargs.

Why self.kwargs should have highest precedence

This ensures that model-level configuration (which users can control) always takes precedence over internal method calls (which users cannot control without subclassing).

This should allow users to easily fix issues like these for future models:

Test Coverage

Added comprehensive pytest test covering parameter precedence and REMOVE_PARAMETER functionality.

Fix #1676.