Spaces:
Running
Running
Update tests.py
Browse files
tests.py
CHANGED
@@ -193,9 +193,13 @@ def create_code_files(filename: str, code) -> dict:
|
|
193 |
global destination_dir
|
194 |
transfer_files()
|
195 |
transfer_files2()
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
199 |
return {"info":"task completed. The referenced code files were created successfully. "}
|
200 |
|
201 |
@mcp.tool()
|
|
|
193 |
global destination_dir
|
194 |
transfer_files()
|
195 |
transfer_files2()
|
196 |
+
if isinstance(code, dict):
|
197 |
+
with open(os.path.join(destination_dir, filename), 'w', encoding='utf-8') as f:
|
198 |
+
json.dump(x, f, ensure_ascii=False, indent=4)
|
199 |
+
else:
|
200 |
+
f = open(os.path.join(destination_dir, filename), "w")
|
201 |
+
f.write(str(code))
|
202 |
+
f.close()
|
203 |
return {"info":"task completed. The referenced code files were created successfully. "}
|
204 |
|
205 |
@mcp.tool()
|