fix stop type errors]

This commit is contained in:
Brandon Hancock
2025-01-22 11:18:18 -05:00
parent dc2e684877
commit 0ddf84a1d0

View File

@@ -160,6 +160,14 @@ class LLM:
litellm.drop_params = True litellm.drop_params = True
# Normalize self.stop to always be a List[str]
if stop is None:
self.stop: List[str] = []
elif isinstance(stop, str):
self.stop = [stop]
else:
self.stop = stop
self.set_callbacks(callbacks) self.set_callbacks(callbacks)
self.set_env_callbacks() self.set_env_callbacks()