pycoze 0.1.332__py3-none-any.whl → 0.1.333__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.
- pycoze/bot/lib.py +21 -11
- pycoze/bot/prompt.md +2 -0
- {pycoze-0.1.332.dist-info → pycoze-0.1.333.dist-info}/METADATA +1 -1
- {pycoze-0.1.332.dist-info → pycoze-0.1.333.dist-info}/RECORD +7 -7
- {pycoze-0.1.332.dist-info → pycoze-0.1.333.dist-info}/LICENSE +0 -0
- {pycoze-0.1.332.dist-info → pycoze-0.1.333.dist-info}/WHEEL +0 -0
- {pycoze-0.1.332.dist-info → pycoze-0.1.333.dist-info}/top_level.txt +0 -0
pycoze/bot/lib.py
CHANGED
@@ -68,25 +68,35 @@ def get_system_prompt(abilities, bot_setting):
|
|
68
68
|
|
69
69
|
|
70
70
|
abilities_str = "\n".join([function_to_string(a) for a in abilities])
|
71
|
+
|
71
72
|
context = {
|
72
73
|
"prompt": bot_setting["prompt"],
|
73
74
|
"system": system,
|
74
75
|
"cd_prompt": cd_prompt,
|
75
76
|
"abilities_str": abilities_str,
|
76
|
-
"programmer_mode":
|
77
|
-
"no_exit_if_incomplete":
|
78
|
-
"allow_read_file":
|
79
|
-
"allow_read_multiple_files":
|
80
|
-
"allow_execute_command":
|
81
|
-
"allow_write_or_overwrite_file":
|
82
|
-
"allow_replace_part_of_a_file":
|
83
|
-
"allow_search_files":
|
84
|
-
"allow_list_files":
|
85
|
-
"allow_access_webpage":
|
86
|
-
|
77
|
+
"programmer_mode": False,
|
78
|
+
"no_exit_if_incomplete": False,
|
79
|
+
"allow_read_file": False,
|
80
|
+
"allow_read_multiple_files": False,
|
81
|
+
"allow_execute_command": False,
|
82
|
+
"allow_write_or_overwrite_file": False,
|
83
|
+
"allow_replace_part_of_a_file": False,
|
84
|
+
"allow_search_files": False,
|
85
|
+
"allow_list_files": False,
|
86
|
+
"allow_access_webpage": False,
|
87
87
|
}
|
88
88
|
|
89
89
|
context.update(bot_setting["systemAbility"])
|
90
|
+
|
91
|
+
has_any_tool = False
|
92
|
+
if len(abilities) > 0:
|
93
|
+
has_any_tool = True
|
94
|
+
for key in bot_setting["systemAbility"]:
|
95
|
+
if key != "programmer_mode" and bot_setting["systemAbility"][key] == True:
|
96
|
+
has_any_tool = True
|
97
|
+
break
|
98
|
+
|
99
|
+
context["has_any_tool"] = has_any_tool
|
90
100
|
system_prompt = template.render(context)
|
91
101
|
|
92
102
|
return system_prompt
|
pycoze/bot/prompt.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
{{ prompt }}
|
2
2
|
|
3
|
+
{% if has_any_tool %}
|
3
4
|
==== Tool Usage
|
4
5
|
You have access to a set of tools running on the {{ system }} system that are executed upon user approval. Only one tool can be used per message, and you will receive the result of the tool's execution in the user's response. You progressively use these tools to accomplish tasks, with each tool's usage being based on the outcome of the previous tool.
|
5
6
|
|
@@ -17,6 +18,7 @@ Here's the translation in English:
|
|
17
18
|
}
|
18
19
|
}
|
19
20
|
```
|
21
|
+
{% endif %}
|
20
22
|
|
21
23
|
{% if allow_read_file %}
|
22
24
|
For example:
|
@@ -14,9 +14,9 @@ pycoze/api/lib/window.py,sha256=bTkQCzQZ7i3pYXB70bUSTBNJ9C4TW_X3yMae1VkquGk,1944
|
|
14
14
|
pycoze/bot/__init__.py,sha256=rL3Q-ycczRpSFfKn84fg3QBl5k22WpyeIU5qOEjEby8,79
|
15
15
|
pycoze/bot/chat.py,sha256=cYMXFe0hgN0CTcI5BiUtte2eTZwgYLKq1vBDQ-eqB5c,3246
|
16
16
|
pycoze/bot/chat_base.py,sha256=czmOKUum3Rwo4lAOJtfslxaF8RKauWzj26s_WMmQa48,9180
|
17
|
-
pycoze/bot/lib.py,sha256=
|
17
|
+
pycoze/bot/lib.py,sha256=ldT9zEXzAVr3XUGs965LHD8R-SO5C4jbytj6nPnYoL8,7210
|
18
18
|
pycoze/bot/message.py,sha256=Zq-_k8HztBMOUIs3hbOvWvwHBNopn4UJJBliCROIGcc,718
|
19
|
-
pycoze/bot/prompt.md,sha256=
|
19
|
+
pycoze/bot/prompt.md,sha256=XHP8EdtzmnlMbM0xTe5GKnjAIFq7KauUARiNly2atz4,15777
|
20
20
|
pycoze/bot/tools.py,sha256=j8l0sXEPn_yjTllHcmYEr_auVDuOicXdDco4bhZVIIA,9694
|
21
21
|
pycoze/reference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
pycoze/reference/bot.py,sha256=pxHVYo0G3P3YZ--vBYbMEiEyBoxxPwaO5dMTf9WFMSc,2014
|
@@ -33,8 +33,8 @@ pycoze/utils/arg.py,sha256=jop1tBfe5hYkHW1NSpCeaZBEznkgguBscj_7M2dWfrs,503
|
|
33
33
|
pycoze/utils/env.py,sha256=5pWlXfM1F5ZU9hhv1rHlDEanjEW5wf0nbyez9bNRqqA,559
|
34
34
|
pycoze/utils/socket.py,sha256=bZbFFRH4mfThzRqt55BAAGQ6eICx_ja4x8UGGrUdAm8,2428
|
35
35
|
pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
|
36
|
-
pycoze-0.1.
|
37
|
-
pycoze-0.1.
|
38
|
-
pycoze-0.1.
|
39
|
-
pycoze-0.1.
|
40
|
-
pycoze-0.1.
|
36
|
+
pycoze-0.1.333.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
|
37
|
+
pycoze-0.1.333.dist-info/METADATA,sha256=-uEQHEdXURdiEaD_eWQmILs9_yZsvBgzMfIW9Wbotjc,854
|
38
|
+
pycoze-0.1.333.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
39
|
+
pycoze-0.1.333.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
|
40
|
+
pycoze-0.1.333.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|