mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-25 16:18:13 +00:00
Fix 'list.remove(x): x not in list' error in crewai chat command
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -964,11 +964,19 @@ class LLM:
|
||||
callback_types = [type(callback) for callback in callbacks]
|
||||
for callback in litellm.success_callback[:]:
|
||||
if type(callback) in callback_types:
|
||||
litellm.success_callback.remove(callback)
|
||||
try:
|
||||
litellm.success_callback.remove(callback)
|
||||
except ValueError:
|
||||
# Skip if callback is not in the list
|
||||
pass
|
||||
|
||||
for callback in litellm._async_success_callback[:]:
|
||||
if type(callback) in callback_types:
|
||||
litellm._async_success_callback.remove(callback)
|
||||
try:
|
||||
litellm._async_success_callback.remove(callback)
|
||||
except ValueError:
|
||||
# Skip if callback is not in the list
|
||||
pass
|
||||
|
||||
litellm.callbacks = callbacks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user