From 2fb1fe15778375fe0dab3c7eef0fe9eaf44a8b3e Mon Sep 17 00:00:00 2001 From: Tarraann Date: Thu, 24 Aug 2023 15:22:47 +0530 Subject: [PATCH] made changes to github helper --- superagi/helper/github_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/superagi/helper/github_helper.py b/superagi/helper/github_helper.py index b3058c401..381e7392a 100644 --- a/superagi/helper/github_helper.py +++ b/superagi/helper/github_helper.py @@ -218,12 +218,12 @@ def add_file(self, repository_owner, repository_name, file_name, folder_path, he Returns: None """ - body = self._get_file_content(file_name, agent_id, agent_execution_id, session) + body = self._get_file_contents(file_name, agent_id, agent_execution_id, session) body_bytes = body.encode("ascii") base64_bytes = base64.b64encode(body_bytes) file_content = base64_bytes.decode("ascii") file_path = self.get_file_path(file_name, folder_path) - file_url = f'https://api.github.com/repos/{self.github_username}/{repository_name}/contents/{file_path}' + file_url = f'https://api.github.com/repos/{repository_owner}/{repository_name}/contents/{file_path}' file_params = { 'message': commit_message, 'content': file_content, @@ -328,6 +328,7 @@ def _get_file_contents(self, file_name, agent_id, agent_execution_id, session): agent=Agent.get_agent_from_id(session, agent_id), agent_execution=AgentExecution.get_agent_execution_from_id( session, agent_execution_id)) + if StorageType.get_storage_type(get_config("STORAGE_TYPE", StorageType.FILE.value)) == StorageType.S3: attachment_data = S3Helper().read_from_s3(final_path) else: