mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 14:34:23 +01:00
Add list type check
This commit is contained in:
@@ -128,7 +128,13 @@ def execute_command(command_name: str, arguments):
|
||||
return google_result
|
||||
else:
|
||||
google_result = google_search(arguments["input"])
|
||||
safe_message = [google_result_single.encode('utf-8', 'ignore') for google_result_single in google_result]
|
||||
|
||||
# google_result can be a list or a string depending on the search results
|
||||
if isinstance(google_result, list):
|
||||
safe_message = [google_result_single.encode('utf-8', 'ignore') for google_result_single in google_result]
|
||||
else:
|
||||
safe_message = google_result.encode('utf-8', 'ignore')
|
||||
|
||||
return str(safe_message)
|
||||
elif command_name == "memory_add":
|
||||
return memory.add(arguments["string"])
|
||||
|
||||
Reference in New Issue
Block a user