Skip to content

Commit

Permalink
log fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluder-Paradyne committed Nov 30, 2023
1 parent c918c13 commit f86bcb5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions superagi/agent/output_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def handle(self, session, assistant_reply):
for task in reversed(tasks):
self.task_queue.add_task(task)
if len(tasks) > 0:
#logger.info("Adding task to queue: " + str(tasks))
logger.info("Adding task to queue: " + str(tasks))
agent_execution = AgentExecution.find_by_id(session, self.agent_execution_id)
for task in tasks:
agent_execution_feed = AgentExecutionFeed(agent_execution_id=self.agent_execution_id,
Expand Down Expand Up @@ -182,7 +182,7 @@ def handle(self, session, assistant_reply):
for task in reversed(tasks):
self.task_queue.add_task(task)
if len(tasks) > 0:
#logger.info("Tasks reprioritized in order: " + str(tasks))
logger.info("Tasks reprioritized in order: " + str(tasks))
status = "COMPLETE" if len(self.task_queue.get_tasks()) == 0 else "PENDING"
session.commit()
return TaskExecutorResponse(status=status, retry=False)
Expand Down
28 changes: 14 additions & 14 deletions superagi/helper/github_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ def sync_branch(self, repository_owner, repository_name, base_branch, head_branc
}
response = requests.patch(head_branch_url, json=data, headers=headers)
if response.status_code == 200:
#logger.info(
logger.info(
f'Successfully synced {self.github_username}:{head_branch} branch with {repository_owner}:{base_branch}')
else:
#logger.info('Failed to sync the branch. Check your inputs and permissions.')
logger.info('Failed to sync the branch. Check your inputs and permissions.')

def make_fork(self, repository_owner, repository_name, base_branch, headers):
"""
Expand All @@ -140,7 +140,7 @@ def make_fork(self, repository_owner, repository_name, base_branch, headers):
#logger.info('Fork created successfully.')
self.sync_branch(repository_owner, repository_name, base_branch, base_branch, headers)
else:
#logger.info('Failed to create the fork:', fork_response.json()['message'])
logger.info('Failed to create the fork:', fork_response.json()['message'])

return fork_response.status_code

Expand All @@ -166,11 +166,11 @@ def create_branch(self, repository_name, base_branch, head_branch, headers):
}
branch_response = requests.post(branch_url, json=branch_params, headers=headers)
if branch_response.status_code == 201:
#logger.info('Branch created successfully.')
logger.info('Branch created successfully.')
elif branch_response.status_code == 422:
#logger.info('Branch new-file already exists, making commits to new-file branch')
logger.info('Branch new-file already exists, making commits to new-file branch')
else:
#logger.info('Failed to create branch:', branch_response.json()['message'])
logger.info('Failed to create branch:', branch_response.json()['message'])

return branch_response.status_code

Expand Down Expand Up @@ -198,9 +198,9 @@ def delete_file(self, repository_name, file_name, folder_path, commit_message, h
}
file_response = requests.delete(file_url, json=file_params, headers=headers)
if file_response.status_code == 200:
#logger.info('File or folder delete successfully.')
logger.info('File or folder delete successfully.')
else:
#logger.info('Failed to Delete file or folder:', file_response.json())
logger.info('Failed to Delete file or folder:', file_response.json())

return file_response.status_code

Expand Down Expand Up @@ -232,11 +232,11 @@ def add_file(self, repository_owner, repository_name, file_name, folder_path, he
}
file_response = requests.put(file_url, json=file_params, headers=headers)
if file_response.status_code == 201:
#logger.info('File content uploaded successfully.')
logger.info('File content uploaded successfully.')
elif file_response.status_code == 422:
#logger.info('File already exists')
logger.info('File already exists')
else:
#logger.info('Failed to upload file content:', file_response.json()['message'])
logger.info('Failed to upload file content:', file_response.json()['message'])
return file_response.status_code


Expand Down Expand Up @@ -265,11 +265,11 @@ def create_pull_request(self, repository_owner, repository_name, head_branch, ba
pr_response = requests.post(pull_request_url, json=pull_request_params, headers=headers)

if pr_response.status_code == 201:
#logger.info('Pull request created successfully.')
logger.info('Pull request created successfully.')
elif pr_response.status_code == 422:
#logger.info('Added changes to already existing pull request')
logger.info('Added changes to already existing pull request')
else:
#logger.info('Failed to create pull request:', pr_response.json()['message'])
logger.info('Failed to create pull request:', pr_response.json()['message'])

return pr_response.status_code

Expand Down
2 changes: 1 addition & 1 deletion superagi/helper/validate_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def correct_csv_encoding(file_path):
df.to_csv(file_path, encoding='utf-8', index=False)
#logger.info("File is converted to utf-8 encoding.")
else:
#logger.info("File is already in utf-8 encoding.")
logger.info("File is already in utf-8 encoding.")
4 changes: 2 additions & 2 deletions superagi/tools/code/improve_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ def _execute(self) -> str:
# Extract the response first
response = result.get('response')
if not response:
#logger.info("RESPONSE NOT AVAILABLE")
logger.info("RESPONSE NOT AVAILABLE")

# Now extract the choices from response
choices = response.get('choices')
if not choices:
#logger.info("CHOICES NOT AVAILABLE")
logger.info("CHOICES NOT AVAILABLE")

# Now you can safely extract the message content
improved_content = choices[0]["message"]["content"]
Expand Down

0 comments on commit f86bcb5

Please sign in to comment.