fix: set tool_choice to none for non-fncall models (#6652)

This commit is contained in:
Xingyao Wang 2025-02-07 12:49:08 -05:00 committed by GitHub
parent 5fa2634d60
commit 52ac2729f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -232,6 +232,9 @@ class LLM(RetryMixin, DebugMixin):
kwargs['stop'] = STOP_WORDS
mock_fncall_tools = kwargs.pop('tools')
kwargs['tool_choice'] = (
'none' # force no tool calling because we're mocking it - without it, it will cause issue with sglang
)
# if we have no messages, something went very wrong
if not messages: