Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superagi/controllers/agent_execution_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def get_agent_execution_feed(agent_execution_id: int,
for feed in feeds:
if feed.error_message:
if (agent_execution.last_shown_error_id is None) or (feed.id > agent_execution.last_shown_error_id):
#new error occured
#new error occurred
error = feed.error_message
agent_execution.last_shown_error_id = feed.id
agent_execution.status = "ERROR_PAUSED"
Expand Down
2 changes: 1 addition & 1 deletion superagi/helper/webhook_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def agent_status_change_callback(self, agent_execution_id, curr_status, old_stat
try:
request = requests.post(webhook_obj.url.strip(), data=json.dumps(webhook_obj_body), headers=webhook_obj.headers)
except Exception as e:
logger.error(f"Exception occured in webhooks {e}")
logger.error(f"Exception occurred in webhooks {e}")
error=str(e)
if request is not None and request.status_code not in [200,201] and error is None:
error=request.text
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/llms/test_open_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_chat_completion_retry_timeout_error(mock_openai, mock_wait_random_expon
messages = [{"role": "system", "content": "You are a helpful assistant."}]
max_tokens = 100

mock_openai.ChatCompletion.create.side_effect = openai.error.Timeout("Timeout occured")
mock_openai.ChatCompletion.create.side_effect = openai.error.Timeout("Timeout occurred")

# Mock sleep time
mock_wait_random_exponential.return_value = 0.1
Expand All @@ -79,7 +79,7 @@ def test_chat_completion_retry_timeout_error(mock_openai, mock_wait_random_expon
result = openai_instance.chat_completion(messages, max_tokens)

# Assert
assert result == {"error": "ERROR_OPENAI", "message": "Open ai exception: Timeout occured"}
assert result == {"error": "ERROR_OPENAI", "message": "Open ai exception: Timeout occurred"}
assert mock_openai.ChatCompletion.create.call_count == MAX_RETRY_ATTEMPTS


Expand Down