🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
feat: test s3
莘权 马7881937e8fb3
diff --git a/metagpt/utils/s3.py b/metagpt/utils/s3.pyindex 6df244197..74c3f1654 100644--- a/metagpt/utils/s3.py+++ b/metagpt/utils/s3.py@@ -129,13 +129,13 @@ class S3:logger.error(f"Failed to download the file from S3: {e}")raise e- async def cache(self, data: str, format: str = "") -> str:+ async def cache(self, data: str, file_ext: str, format: str = "") -> str:"""Save data to remote S3 and return url"""- object_name = str(uuid.uuid4()).replace("-", "")+ object_name = str(uuid.uuid4()).replace("-", "") + file_extpath = Path(__file__).parentpathname = path / object_nametry:- async with aiofiles.open(str(pathname), mode="w") as file:+ async with aiofiles.open(str(pathname), mode="wb") as file:if format == BASE64_FORMAT:data = base64.b64decode(data)await file.write(data)