mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-02 05:30:48 +00:00
BIG PYTHON REFACTOR
Python scripts moved out of python/ folder to root to be unified with plugins + frontend extension around api calls
This commit is contained in:
parent
f94b7d742c
commit
d02dda3667
326 changed files with 1096 additions and 862 deletions
|
|
@ -1,24 +0,0 @@
|
|||
import json
|
||||
import yaml
|
||||
|
||||
|
||||
def loads(text: str):
|
||||
return yaml.safe_load(text)
|
||||
|
||||
|
||||
def dumps(obj, **kwargs) -> str:
|
||||
dump_kwargs = {
|
||||
"allow_unicode": True,
|
||||
"sort_keys": False,
|
||||
**kwargs,
|
||||
}
|
||||
return yaml.safe_dump(obj, **dump_kwargs)
|
||||
|
||||
|
||||
def from_json(text: str, **yaml_dump_kwargs) -> str:
|
||||
return dumps(json.loads(text), **yaml_dump_kwargs)
|
||||
|
||||
|
||||
def to_json(text: str, **json_dump_kwargs) -> str:
|
||||
obj = loads(text)
|
||||
return json.dumps(obj, ensure_ascii=False, **json_dump_kwargs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue