Skip to content

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

[HOTFIX] Correct handling of non-existent file in insert_text_file (#735)

idontwanttosayaword565a46ea3645
diff --git a/src/agentscope/tool/_text_file/_write_text_file.py b/src/agentscope/tool/_text_file/_write_text_file.py
index de7a0b40b..74d50263c 100644
--- a/src/agentscope/tool/_text_file/_write_text_file.py
+++ b/src/agentscope/tool/_text_file/_write_text_file.py
@@ -42,8 +42,6 @@ async def insert_text_file(
)
if not os.path.exists(file_path):
- with open(file_path, "w", encoding="utf-8") as file:
- file.write(content + "\n")
return ToolResponse(
content=[
TextBlock(