pycoze 0.1.393__py3-none-any.whl → 0.1.394__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/chat.py +5 -1
- pycoze/bot/chat_base.py +11 -7
- {pycoze-0.1.393.dist-info → pycoze-0.1.394.dist-info}/METADATA +1 -1
- {pycoze-0.1.393.dist-info → pycoze-0.1.394.dist-info}/RECORD +7 -7
- {pycoze-0.1.393.dist-info → pycoze-0.1.394.dist-info}/LICENSE +0 -0
- {pycoze-0.1.393.dist-info → pycoze-0.1.394.dist-info}/WHEEL +0 -0
- {pycoze-0.1.393.dist-info → pycoze-0.1.394.dist-info}/top_level.txt +0 -0
pycoze/bot/chat.py
CHANGED
@@ -59,6 +59,7 @@ async def run_with_interrupt_check(
|
|
59
59
|
abilities,
|
60
60
|
has_any_tool,
|
61
61
|
bot_setting,
|
62
|
+
bot_setting_file:str,
|
62
63
|
interrupt_file,
|
63
64
|
):
|
64
65
|
clear_chat_data()
|
@@ -71,6 +72,7 @@ async def run_with_interrupt_check(
|
|
71
72
|
abilities,
|
72
73
|
has_any_tool,
|
73
74
|
bot_setting,
|
75
|
+
bot_setting_file
|
74
76
|
)
|
75
77
|
)
|
76
78
|
check_task = asyncio.create_task(
|
@@ -138,6 +140,7 @@ def chat(bot_setting_file: str):
|
|
138
140
|
abilities,
|
139
141
|
has_any_tool,
|
140
142
|
bot_setting,
|
143
|
+
bot_setting_file,
|
141
144
|
params["interruptFile"],
|
142
145
|
)
|
143
146
|
)
|
@@ -150,6 +153,7 @@ def chat(bot_setting_file: str):
|
|
150
153
|
abilities,
|
151
154
|
has_any_tool,
|
152
155
|
bot_setting,
|
156
|
+
bot_setting_file,
|
153
157
|
)
|
154
158
|
)
|
155
159
|
output("assistant", CHAT_DATA["info"])
|
@@ -185,7 +189,7 @@ def get_chat_response(bot_setting_file: str, user_input: str):
|
|
185
189
|
]
|
186
190
|
asyncio.run(
|
187
191
|
handle_user_inputs(
|
188
|
-
conversation_history, user_input, cwd, abilities, has_any_tool, bot_setting
|
192
|
+
conversation_history, user_input, cwd, abilities, has_any_tool, bot_setting, bot_setting_file
|
189
193
|
)
|
190
194
|
)
|
191
195
|
|
pycoze/bot/chat_base.py
CHANGED
@@ -36,7 +36,14 @@ def format_content(cwd, potential_paths, conversation_history):
|
|
36
36
|
else ""
|
37
37
|
)
|
38
38
|
|
39
|
-
def generate_user_task_prompt(conversation_history, cwd, user_input: str,
|
39
|
+
def generate_user_task_prompt(conversation_history, cwd, user_input: str, bot_setting_file:str):
|
40
|
+
# 需要重新读取openedFiles和activeFile
|
41
|
+
with open(bot_setting_file, encoding="utf-8") as f:
|
42
|
+
bot_setting = json.load(f)
|
43
|
+
programmer_mode = bot_setting["programmerMode"]
|
44
|
+
opened_files = bot_setting["openedFiles"]
|
45
|
+
active_file = bot_setting["activeFile"]
|
46
|
+
|
40
47
|
if programmer_mode:
|
41
48
|
potential_paths = guess_files_in_message(cwd, user_input)
|
42
49
|
|
@@ -151,14 +158,11 @@ async def stream_openai_response(conversation_history, start_new_stream):
|
|
151
158
|
|
152
159
|
|
153
160
|
async def handle_user_inputs(
|
154
|
-
conversation_history, user_input, cwd, abilities, has_any_tool, bot_setting
|
161
|
+
conversation_history, user_input, cwd, abilities, has_any_tool, bot_setting, bot_setting_file:str
|
155
162
|
):
|
156
163
|
no_exit_if_incomplete = bot_setting["systemAbility"]["no_exit_if_incomplete"]
|
157
|
-
programmer_mode = bot_setting["programmerMode"]
|
158
164
|
show_tool_results = bot_setting["showToolResults"]
|
159
|
-
|
160
|
-
active_file = bot_setting["activeFile"]
|
161
|
-
|
165
|
+
|
162
166
|
start_new_stream = {
|
163
167
|
"value": False
|
164
168
|
} # 当遇到AI准备执行JSON,即需要新信息的时候,用于强制停止当前stream,减少后续无效的tokens
|
@@ -171,7 +175,7 @@ async def handle_user_inputs(
|
|
171
175
|
{
|
172
176
|
"role": "user",
|
173
177
|
"content": generate_user_task_prompt(
|
174
|
-
conversation_history, cwd, user_input,
|
178
|
+
conversation_history, cwd, user_input, bot_setting_file
|
175
179
|
),
|
176
180
|
}
|
177
181
|
)
|
@@ -11,8 +11,8 @@ pycoze/api/lib/view.py,sha256=_PIpTfeuTPPlMDKshMGsqFQYMq7ZiO4Hg5XwHwDoU60,7357
|
|
11
11
|
pycoze/api/lib/web.py,sha256=GWgtiTJOolKOX2drXcwuyqTcbo5FQVxa1NuBGcNyjyc,223
|
12
12
|
pycoze/api/lib/window.py,sha256=dkzWfLwn5pE_L0DfQ38K8nx9tQyT5KO-GYyXi0rytFc,2073
|
13
13
|
pycoze/bot/__init__.py,sha256=rL3Q-ycczRpSFfKn84fg3QBl5k22WpyeIU5qOEjEby8,79
|
14
|
-
pycoze/bot/chat.py,sha256=
|
15
|
-
pycoze/bot/chat_base.py,sha256=
|
14
|
+
pycoze/bot/chat.py,sha256=PGjW1_dzck_OU_YwGhr1xfQFz3gLiZnPC_Objx_IZ9E,6449
|
15
|
+
pycoze/bot/chat_base.py,sha256=pAfvFqOJNC8a2pF28TeouI5HtTILyftzbnD8UJqaqxk,10317
|
16
16
|
pycoze/bot/lib.py,sha256=WMVhyKFXvNoLrS2wvNOakIJXyUmVE6ujCV6XVDV0M6A,7213
|
17
17
|
pycoze/bot/message.py,sha256=udnIi-h4QgGzkbr_5VcAsVGjoLp9wXJSfBCeuOz7_Bk,802
|
18
18
|
pycoze/bot/prompt.md,sha256=YafQyrBhRGny_RrOWW0kk1IVf_MUxcdDH1dAh_-eHmM,13948
|
@@ -32,8 +32,8 @@ pycoze/utils/arg.py,sha256=jop1tBfe5hYkHW1NSpCeaZBEznkgguBscj_7M2dWfrs,503
|
|
32
32
|
pycoze/utils/env.py,sha256=5pWlXfM1F5ZU9hhv1rHlDEanjEW5wf0nbyez9bNRqqA,559
|
33
33
|
pycoze/utils/socket.py,sha256=bZbFFRH4mfThzRqt55BAAGQ6eICx_ja4x8UGGrUdAm8,2428
|
34
34
|
pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
|
35
|
-
pycoze-0.1.
|
36
|
-
pycoze-0.1.
|
37
|
-
pycoze-0.1.
|
38
|
-
pycoze-0.1.
|
39
|
-
pycoze-0.1.
|
35
|
+
pycoze-0.1.394.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
|
36
|
+
pycoze-0.1.394.dist-info/METADATA,sha256=d9-r-wpNgk0aq0qsh8Onb5TF1or1kAH5YMH7CMAyxL0,854
|
37
|
+
pycoze-0.1.394.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
38
|
+
pycoze-0.1.394.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
|
39
|
+
pycoze-0.1.394.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|