Add llm disable stop word env var (#10274)

Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
This commit is contained in:
Jesse
2025-08-12 23:52:11 -04:00
committed by GitHub
parent 50aa014876
commit 4e3a862571
2 changed files with 6 additions and 2 deletions

View File

@@ -305,8 +305,11 @@ class LLM(RetryMixin, DebugMixin):
)
kwargs['messages'] = messages
# add stop words if the model supports it
if self.config.model not in MODELS_WITHOUT_STOP_WORDS:
# add stop words if the model supports it and stop words are not disabled
if (
self.config.model not in MODELS_WITHOUT_STOP_WORDS
and not self.config.disable_stop_word
):
kwargs['stop'] = STOP_WORDS
mock_fncall_tools = kwargs.pop('tools')