From 1001e5489e2f4d4e134f0593eab3a76e5a3a849a Mon Sep 17 00:00:00 2001 From: jingxing Date: Mon, 17 Apr 2023 14:24:10 +0800 Subject: [PATCH 1/4] config.py format --- autogpt/config/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogpt/config/config.py b/autogpt/config/config.py index fe6f4f32..8dc3b487 100644 --- a/autogpt/config/config.py +++ b/autogpt/config/config.py @@ -67,7 +67,7 @@ class Config(metaclass=Singleton): self.pinecone_api_key = os.getenv("PINECONE_API_KEY") self.pinecone_region = os.getenv("PINECONE_ENV") - self.weaviate_host = os.getenv("WEAVIATE_HOST") + self.weaviate_host = os.getenv("WEAVIATE_HOST") self.weaviate_port = os.getenv("WEAVIATE_PORT") self.weaviate_protocol = os.getenv("WEAVIATE_PROTOCOL", "http") self.weaviate_username = os.getenv("WEAVIATE_USERNAME", None) From a2e75aabdd41c40653bbbc4ed7a8937a0b9ddfb4 Mon Sep 17 00:00:00 2001 From: gklab Date: Fri, 21 Apr 2023 10:19:28 +0800 Subject: [PATCH 2/4] adjust file_operations.py code format --- autogpt/commands/file_operations.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py index b73fb987..00ddcd02 100644 --- a/autogpt/commands/file_operations.py +++ b/autogpt/commands/file_operations.py @@ -49,7 +49,7 @@ def log_operation(operation: str, filename: str) -> None: with open(LOG_FILE_PATH, "w", encoding="utf-8") as f: f.write("File Operation Logger ") - append_to_file(LOG_FILE, log_entry, shouldLog=False) + append_to_file(LOG_FILE, log_entry, should_log=False) def split_file( @@ -72,7 +72,7 @@ def split_file( while start < content_length: end = start + max_length if end + overlap < content_length: - chunk = content[start : end + overlap - 1] + chunk = content[start:end + overlap - 1] else: chunk = content[start:content_length] @@ -166,12 +166,13 @@ def write_to_file(filename: str, text: str) -> str: @command( "append_to_file", "Append to file", '"filename": "", "text": ""' ) -def append_to_file(filename: str, text: str, shouldLog: bool = True) -> str: +def append_to_file(filename: str, text: str, should_log: bool = True) -> str: """Append text to a file Args: filename (str): The name of the file to append to text (str): The text to append to the file + should_log (bool): Should log output Returns: str: A message indicating success or failure @@ -181,7 +182,7 @@ def append_to_file(filename: str, text: str, shouldLog: bool = True) -> str: with open(filepath, "a") as f: f.write(text) - if shouldLog: + if should_log: log_operation("append", filename) return "Text appended successfully." From 45a9ff6e74e1e978698e8fec31da66486c2c30e8 Mon Sep 17 00:00:00 2001 From: ZHAOKAI WANG Date: Fri, 21 Apr 2023 13:03:52 +0800 Subject: [PATCH 3/4] Update file_operations.py --- autogpt/commands/file_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py index 00ddcd02..7b95d972 100644 --- a/autogpt/commands/file_operations.py +++ b/autogpt/commands/file_operations.py @@ -72,7 +72,7 @@ def split_file( while start < content_length: end = start + max_length if end + overlap < content_length: - chunk = content[start:end + overlap - 1] + chunk = content[start: end + overlap - 1] else: chunk = content[start:content_length] From e7c2a4068eb7d3c1e9bdb4acac1c65b951e7cb65 Mon Sep 17 00:00:00 2001 From: ZHAOKAI WANG Date: Fri, 21 Apr 2023 13:06:44 +0800 Subject: [PATCH 4/4] Update file_operations.py --- autogpt/commands/file_operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py index 7b95d972..7e17a1b0 100644 --- a/autogpt/commands/file_operations.py +++ b/autogpt/commands/file_operations.py @@ -72,7 +72,7 @@ def split_file( while start < content_length: end = start + max_length if end + overlap < content_length: - chunk = content[start: end + overlap - 1] + chunk = content[start : end + overlap - 1] else: chunk = content[start:content_length]