Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

refactor: uuid

莘权 马768e934444bb
diff --git a/metagpt/tools/iflytek_tts.py b/metagpt/tools/iflytek_tts.py
index a91d8091b..cb87d2e7f 100644
--- a/metagpt/tools/iflytek_tts.py
+++ b/metagpt/tools/iflytek_tts.py
@@ -136,7 +136,7 @@ async def oas3_iflytek_tts(text: str, voice: str = "", app_id: str = "", api_key
if not voice:
voice = CONFIG.IFLYTEK_VOICE or DEFAULT_IFLYTEK_VOICE
- filename = Path(__file__).parent / (str(uuid.uuid4()).replace("-", "") + ".mp3")
+ filename = Path(__file__).parent / (uuid.uuid4().hex + ".mp3")
try:
tts = IFlyTekTTS(app_id=app_id, api_key=api_key, api_secret=api_secret)
await tts.synthesize_speech(text=text, output_file=str(filename), voice=voice)
diff --git a/metagpt/utils/s3.py b/metagpt/utils/s3.py
index 96b457972..dde68f720 100644
--- a/metagpt/utils/s3.py
+++ b/metagpt/utils/s3.py
@@ -132,7 +132,7 @@ class S3:
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("-", "") + file_ext
+ object_name = uuid.uuid4().hex + file_ext
path = Path(__file__).parent
pathname = path / object_name
try: