pycoze 0.1.63__tar.gz → 0.1.65__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pycoze-0.1.63 → pycoze-0.1.65}/PKG-INFO +1 -1
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/ui/base.py +11 -10
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze.egg-info/PKG-INFO +1 -1
- {pycoze-0.1.63 → pycoze-0.1.65}/setup.py +1 -1
- {pycoze-0.1.63 → pycoze-0.1.65}/LICENSE +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/README.md +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/access/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/access/tool_for_bot.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/agent.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/agent_types/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/agent_types/react_agent.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/agent_types/react_prompt.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/assistant.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/agent/chat.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/bot/bot.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/gpu/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/gpu/gpu_reserve.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/module.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/ui/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/ui/color.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/ui/typ.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/ui/ui_def.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/utils/__init__.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/utils/arg.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze/utils/text_or_file.py +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze.egg-info/SOURCES.txt +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze.egg-info/dependency_links.txt +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/pycoze.egg-info/top_level.txt +0 -0
- {pycoze-0.1.63 → pycoze-0.1.65}/setup.cfg +0 -0
@@ -4,23 +4,24 @@ import json
|
|
4
4
|
import inspect
|
5
5
|
|
6
6
|
|
7
|
-
params_file = utils.read_arg(
|
7
|
+
params_file = utils.read_arg("params_file", True)
|
8
8
|
params = None
|
9
9
|
try:
|
10
|
-
with open(params_file,
|
10
|
+
with open(params_file, "r", encoding="utf-8") as f:
|
11
11
|
params = json.load(f)
|
12
12
|
except Exception as e:
|
13
13
|
print(e)
|
14
14
|
|
15
|
+
|
15
16
|
def get_ui():
|
16
17
|
if params is None:
|
17
18
|
return {}
|
18
19
|
stack = inspect.stack()
|
19
|
-
stack_files = list(reversed([s.filename.replace(
|
20
|
+
stack_files = list(reversed([s.filename.replace("\\", "/") for s in stack]))
|
20
21
|
match_item = None
|
21
22
|
for f in stack_files:
|
22
|
-
for v in params["uiData"]:
|
23
|
-
if v
|
23
|
+
for v in params["uiData"]["uiFiles"]:
|
24
|
+
if v == f:
|
24
25
|
match_item = v
|
25
26
|
break
|
26
27
|
if match_item:
|
@@ -29,19 +30,19 @@ def get_ui():
|
|
29
30
|
if not match_item:
|
30
31
|
raise Exception("uiData not found for file")
|
31
32
|
|
32
|
-
by =
|
33
|
+
by = params["uiData"]["by"]
|
33
34
|
|
34
35
|
for i in range(10):
|
35
36
|
try:
|
36
|
-
if by ==
|
37
|
+
if by == "file":
|
37
38
|
json_file = match_item["Jsonfile"]
|
38
|
-
with open(json_file, "r", encoding=
|
39
|
+
with open(json_file, "r", encoding="utf-8") as f:
|
39
40
|
return json.load(f)
|
40
41
|
else:
|
41
|
-
assert by ==
|
42
|
+
assert by == "node"
|
42
43
|
workflow_file = match_item["workflowFile"]
|
43
44
|
node_id = match_item["nodeId"]
|
44
|
-
with open(workflow_file, "r", encoding=
|
45
|
+
with open(workflow_file, "r", encoding="utf-8") as f:
|
45
46
|
cells = json.load(f)["graph"]["cells"]
|
46
47
|
node = [cell for cell in cells if cell["id"] == node_id][0]
|
47
48
|
return json.loads(node["data"]["ui"])
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|