Skip to content

Build and run agents you can see, understand and trust.

fix(utils): resolve double dot in file extension when saving base64 data (#1289)

YingchaoXda39760e5ba1
diff --git a/src/agentscope/_utils/_common.py b/src/agentscope/_utils/_common.py
index 5b2601340..c69b270b5 100644
--- a/src/agentscope/_utils/_common.py
+++ b/src/agentscope/_utils/_common.py
@@ -176,7 +176,7 @@ def _save_base64_data(
extension = "." + media_type.split("/")[-1]
with tempfile.NamedTemporaryFile(
- suffix=f".{extension}",
+ suffix=extension,
delete=False,
) as temp_file:
decoded_data = base64.b64decode(base64_data)