zrb 1.13.2__py3-none-any.whl → 1.13.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
zrb/builtin/llm/tool/file.py
CHANGED
@@ -2,7 +2,7 @@ import fnmatch
|
|
2
2
|
import json
|
3
3
|
import os
|
4
4
|
import re
|
5
|
-
from typing import Any, Dict, List, Optional
|
5
|
+
from typing import Any, Dict, List, Optional, Tuple
|
6
6
|
|
7
7
|
from zrb.builtin.llm.tool.sub_agent import create_sub_agent_tool
|
8
8
|
from zrb.config.config import CFG
|
@@ -507,7 +507,7 @@ def read_many_files(paths: List[str]) -> str:
|
|
507
507
|
return json.dumps({"results": results})
|
508
508
|
|
509
509
|
|
510
|
-
def write_many_files(files:
|
510
|
+
def write_many_files(files: List[Tuple[str, str]]) -> str:
|
511
511
|
"""
|
512
512
|
Writes content to multiple files in a single, atomic operation.
|
513
513
|
|
@@ -516,7 +516,7 @@ def write_many_files(files: Dict[str, str]) -> str:
|
|
516
516
|
Each file's content is completely replaced. If a file does not exist, it will be created. If it exists, its current content will be entirely overwritten. Therefore, you must provide the full, intended content for each file.
|
517
517
|
|
518
518
|
Args:
|
519
|
-
files (
|
519
|
+
files (List[Tuple[str, str]]): A list of tuples, where each tuple contains the file path and the complete content to be written to that file.
|
520
520
|
|
521
521
|
Returns:
|
522
522
|
str: A JSON object summarizing the operation, listing successfully written files and any files that failed, along with corresponding error messages.
|
@@ -524,7 +524,7 @@ def write_many_files(files: Dict[str, str]) -> str:
|
|
524
524
|
"""
|
525
525
|
success = []
|
526
526
|
errors = {}
|
527
|
-
for path, content in files
|
527
|
+
for path, content in files:
|
528
528
|
try:
|
529
529
|
abs_path = os.path.abspath(os.path.expanduser(path))
|
530
530
|
directory = os.path.dirname(abs_path)
|
@@ -18,7 +18,7 @@ zrb/builtin/llm/tool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
18
18
|
zrb/builtin/llm/tool/api.py,sha256=OhmfLc2TwWKQYIMweGelqb5s4JF4nB-YynbSO4yb_Jk,2342
|
19
19
|
zrb/builtin/llm/tool/cli.py,sha256=dUWZrW2X5J_lONuzR__6-SbewSdi28E3RRuksjd4mWo,1234
|
20
20
|
zrb/builtin/llm/tool/code.py,sha256=GRP_IZAkeL6RIlUm407BQRF992ES57pdzPaQdC5UsJU,8218
|
21
|
-
zrb/builtin/llm/tool/file.py,sha256=
|
21
|
+
zrb/builtin/llm/tool/file.py,sha256=OLg8RfWZOypTxTtK7YzyoZp6O2ITszGTaqos-7c0V-c,22288
|
22
22
|
zrb/builtin/llm/tool/rag.py,sha256=wB74JV7bxs0ec77b_09Z2lPjoR1WzPUvZbuXOdb9Q9g,9675
|
23
23
|
zrb/builtin/llm/tool/sub_agent.py,sha256=9Su64FpNTVeE6O2qgNzo-eo4pcmv8qi_sd_QWLQBXYw,4870
|
24
24
|
zrb/builtin/llm/tool/web.py,sha256=gQlUsmYCJOFJtNjwpjK-xk13LMvrMSpSaFHXUTnIayQ,7090
|
@@ -406,7 +406,7 @@ zrb/util/todo.py,sha256=r9_KYF2-hLKMNjsp6AFK9zivykMrywd-kJ4bCwfdafI,19323
|
|
406
406
|
zrb/util/todo_model.py,sha256=hhzAX-uFl5rsg7iVX1ULlJOfBtblwQ_ieNUxBWfc-Os,1670
|
407
407
|
zrb/xcom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
408
408
|
zrb/xcom/xcom.py,sha256=o79rxR9wphnShrcIushA0Qt71d_p3ZTxjNf7x9hJB78,1571
|
409
|
-
zrb-1.13.
|
410
|
-
zrb-1.13.
|
411
|
-
zrb-1.13.
|
412
|
-
zrb-1.13.
|
409
|
+
zrb-1.13.3.dist-info/METADATA,sha256=WhAGmkemQMrm0fxn88gq6bSWUv4KLgruOZTrC_cSmnM,9777
|
410
|
+
zrb-1.13.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
411
|
+
zrb-1.13.3.dist-info/entry_points.txt,sha256=-Pg3ElWPfnaSM-XvXqCxEAa-wfVI6BEgcs386s8C8v8,46
|
412
|
+
zrb-1.13.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|