auto-coder 0.1.371__py3-none-any.whl → 0.1.373__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.
Potentially problematic release.
This version of auto-coder might be problematic. Click here for more details.
- {auto_coder-0.1.371.dist-info → auto_coder-0.1.373.dist-info}/METADATA +2 -2
- {auto_coder-0.1.371.dist-info → auto_coder-0.1.373.dist-info}/RECORD +15 -15
- autocoder/agent/auto_tool.py +4 -3
- autocoder/agent/planner.py +3 -3
- autocoder/agent/project_reader.py +4 -4
- autocoder/chat_auto_coder.py +10 -19
- autocoder/common/v2/agent/agentic_edit.py +12 -8
- autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py +2 -1
- autocoder/rag/llm_wrapper.py +1 -2
- autocoder/rag/rag_entry.py +2 -6
- autocoder/version.py +1 -1
- {auto_coder-0.1.371.dist-info → auto_coder-0.1.373.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.371.dist-info → auto_coder-0.1.373.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.371.dist-info → auto_coder-0.1.373.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.371.dist-info → auto_coder-0.1.373.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.373
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -28,7 +28,7 @@ Requires-Dist: prompt-toolkit
|
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
29
|
Requires-Dist: aiofiles
|
|
30
30
|
Requires-Dist: readerwriterlock
|
|
31
|
-
Requires-Dist: byzerllm[saas] >=0.1.
|
|
31
|
+
Requires-Dist: byzerllm[saas] >=0.1.184
|
|
32
32
|
Requires-Dist: patch
|
|
33
33
|
Requires-Dist: diff-match-patch
|
|
34
34
|
Requires-Dist: GitPython
|
|
@@ -7,14 +7,14 @@ autocoder/auto_coder_rag_mcp.py,sha256=-RrjNwFaS2e5v8XDIrKR-zlUNUE8UBaeOtojffBrv
|
|
|
7
7
|
autocoder/auto_coder_runner.py,sha256=VktQIEWjVMmraVjD7W73eZmYtdfm9Ma2w_Ib-cWZYhM,112263
|
|
8
8
|
autocoder/auto_coder_server.py,sha256=bLORGEclcVdbBVfM140JCI8WtdrU0jbgqdJIVVupiEU,20578
|
|
9
9
|
autocoder/benchmark.py,sha256=Ypomkdzd1T3GE6dRICY3Hj547dZ6_inqJbBJIp5QMco,4423
|
|
10
|
-
autocoder/chat_auto_coder.py,sha256=
|
|
10
|
+
autocoder/chat_auto_coder.py,sha256=vNQwbYkdqeMl07Vx8z6x-kSPkHKn9AT3sSkYMTJiWtc,26655
|
|
11
11
|
autocoder/chat_auto_coder_lang.py,sha256=ylLr1GskchU6kIUJY2TiznrBg-ckc1o-8fDsKZZ0iQU,29337
|
|
12
12
|
autocoder/command_args.py,sha256=HxflngkYtTrV17Vfgk6lyUyiG68jP2ftSc7FYr9AXwY,30585
|
|
13
13
|
autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,10013
|
|
14
14
|
autocoder/lang.py,sha256=PFtATuOhHRnfpqHQkXr6p4C893JvpsgwTMif3l-GEi0,14321
|
|
15
15
|
autocoder/models.py,sha256=Gu50IATQtZtgEir1PpCfwgH6o4ygw6XqqbQRj3lx5dU,13798
|
|
16
16
|
autocoder/run_context.py,sha256=IUfSO6_gp2Wt1blFWAmOpN0b0nDrTTk4LmtCYUBIoro,1643
|
|
17
|
-
autocoder/version.py,sha256=
|
|
17
|
+
autocoder/version.py,sha256=n_1OgRVIzzmD8JoAnBN8M2OwEcNk7LZF2lwEiwlrXcY,25
|
|
18
18
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
autocoder/agent/agentic_edit.py,sha256=XsfePZ-t6M-uBSdG1VLZXk1goqXk2HPeJ_A8IYyBuWQ,58896
|
|
20
20
|
autocoder/agent/agentic_edit_types.py,sha256=oFcDd_cxJ2yH9Ed1uTpD3BipudgoIEWDMPb5pAkq4gI,3288
|
|
@@ -25,11 +25,11 @@ autocoder/agent/auto_guess_query.py,sha256=rDSdhpPHcOGE5MuDXvIrhCXAPR4ARS1LqpyoL
|
|
|
25
25
|
autocoder/agent/auto_learn.py,sha256=EMSbIVo2DK9Lp4sxFtpK4HRxqclGVKHYex51SG7SJpM,13942
|
|
26
26
|
autocoder/agent/auto_learn_from_commit.py,sha256=edD4GQJyO2qvVnTKyldeswWoNeKe1Aaua6ieJzlGlFI,10662
|
|
27
27
|
autocoder/agent/auto_review_commit.py,sha256=1z9FOUDPZTWnrPmJ-TwUlXLOTDPmRcAlYqXbUj1pi08,11015
|
|
28
|
-
autocoder/agent/auto_tool.py,sha256=
|
|
28
|
+
autocoder/agent/auto_tool.py,sha256=EkswqecrV_va6Gh8o6x4t113DNmtUApWdcYRiopLAsw,11583
|
|
29
29
|
autocoder/agent/coder.py,sha256=x6bdJwDuETGg9ebQnYlUWCxCtQcDGg73LtI6McpWslQ,72034
|
|
30
30
|
autocoder/agent/designer.py,sha256=EpRbzO58Xym3GrnppIT1Z8ZFAlnNfgzHbIzZ3PX-Yv8,27037
|
|
31
|
-
autocoder/agent/planner.py,sha256=
|
|
32
|
-
autocoder/agent/project_reader.py,sha256=
|
|
31
|
+
autocoder/agent/planner.py,sha256=2OgJsPVGmp_koEZsdcp2pvtdDzegiMAwxraPc_5GYvo,9215
|
|
32
|
+
autocoder/agent/project_reader.py,sha256=WVl-xvrzseWmv-YBg-bDbdy_OtLdqz0xdadkHc70Lf8,17747
|
|
33
33
|
autocoder/agent/agentic_edit_tools/__init__.py,sha256=wGICCc1dYh07osB21j62zOQ9Ws0PyyOQ12UYRHmHrtI,1229
|
|
34
34
|
autocoder/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py,sha256=8yQq9ypKpq8eU-P-8-p8Pia_9mLRdrqj7s9joRjGDog,1468
|
|
35
35
|
autocoder/agent/agentic_edit_tools/attempt_completion_tool_resolver.py,sha256=Y4E6KTnalEABKmSwWTA_isRITVlBz1LvDHBAOh-rkWM,1297
|
|
@@ -192,13 +192,13 @@ autocoder/common/v2/code_editblock_manager.py,sha256=DMwJw-FAM6VyaBQV3p4xespHpgZ
|
|
|
192
192
|
autocoder/common/v2/code_manager.py,sha256=C403bS-f6urixwitlKHcml-J03hci-UyNwHJOqBiY6Q,9182
|
|
193
193
|
autocoder/common/v2/code_strict_diff_manager.py,sha256=Bys7tFAq4G03R1zUZuxrszBTvP4QB96jIw2y5BDLyRM,9424
|
|
194
194
|
autocoder/common/v2/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
195
|
-
autocoder/common/v2/agent/agentic_edit.py,sha256=
|
|
195
|
+
autocoder/common/v2/agent/agentic_edit.py,sha256=GqzwD-YIuftxz6IGPonE8spxcPBCAiImHPsKuVLQIJE,116459
|
|
196
196
|
autocoder/common/v2/agent/agentic_edit_conversation.py,sha256=pFgWPWHKhZ4J9EcFmIdiGsrSolTZuYcH1qkgKdD8nwk,7726
|
|
197
197
|
autocoder/common/v2/agent/agentic_edit_types.py,sha256=nEcZc2MOZ_fQLaJX-YDha_x9Iim22ao4tykYM2iIy4k,4908
|
|
198
198
|
autocoder/common/v2/agent/agentic_tool_display.py,sha256=-a-JTQLc4q03E_rdIILKMI0B6DHN-5gcGlrqq-mBYK4,7239
|
|
199
199
|
autocoder/common/v2/agent/ignore_utils.py,sha256=gnUchRzKMLbUm_jvnKL-r-K9MWKPtt-6iiuzijY7Es0,1717
|
|
200
200
|
autocoder/common/v2/agent/agentic_edit_tools/__init__.py,sha256=RbPZZcZg_VnGssL577GxSyFrYrxQ_LopJ4G_-mY3z_Q,1337
|
|
201
|
-
autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py,sha256
|
|
201
|
+
autocoder/common/v2/agent/agentic_edit_tools/ask_followup_question_tool_resolver.py,sha256=-HFXo3RR6CH8xXjDaE2mYV4XasTLAmvXe6WutL7qbwA,3208
|
|
202
202
|
autocoder/common/v2/agent/agentic_edit_tools/attempt_completion_tool_resolver.py,sha256=82ZGKeRBSDKeead_XVBW4FxpiE-5dS7tBOk_3RZ6B5s,1511
|
|
203
203
|
autocoder/common/v2/agent/agentic_edit_tools/base_tool_resolver.py,sha256=Zid2m1uZd-2wVFGc_n_KAViXZyNjbdLSpI5n7ut1RUQ,1036
|
|
204
204
|
autocoder/common/v2/agent/agentic_edit_tools/execute_command_tool_resolver.py,sha256=sX00xzczfmyW6yPG3nMm0xO8p-WARQTiD4jcoUiTxsg,3844
|
|
@@ -288,11 +288,11 @@ autocoder/rag/conversation_to_queries.py,sha256=xwmErn4WbdADnhK1me-h_6fV3KYrl_y1
|
|
|
288
288
|
autocoder/rag/doc_filter.py,sha256=UduVO2mlrngwJICrefjDJTYfdmQ4GcRXrfWDQ7xXksk,14206
|
|
289
289
|
autocoder/rag/document_retriever.py,sha256=rFwbAuHTvEFJq16HQNlmRLyJp2ddn2RNFslw_ncU7NI,8847
|
|
290
290
|
autocoder/rag/lang.py,sha256=HvcMeu6jReEJOGxyLMn4rwBoD-myFwmykS3VLceBJLs,3364
|
|
291
|
-
autocoder/rag/llm_wrapper.py,sha256=
|
|
291
|
+
autocoder/rag/llm_wrapper.py,sha256=LsNv8maCnvazyXjjtkO9aN3OT7Br20V1ilHV8Lt45Os,4245
|
|
292
292
|
autocoder/rag/long_context_rag.py,sha256=zLo4SmdZ50Ex8egdXqwVx4Jp5cR1k4UMf49Z-_NbXL0,43550
|
|
293
293
|
autocoder/rag/qa_conversation_strategy.py,sha256=4CiMK88apKbJ2YM4HHq1KGpr5jUkTh0_m_aCyt-JYgc,10568
|
|
294
294
|
autocoder/rag/rag_config.py,sha256=8LwFcTd8OJWWwi1_WY4IzjqgtT6RyE2j4PjxS5cCTDE,802
|
|
295
|
-
autocoder/rag/rag_entry.py,sha256=
|
|
295
|
+
autocoder/rag/rag_entry.py,sha256=QOdUX_nd1Qak2NyOW0CYcLRDB26AZ6MeByHJaMMGgqs,2316
|
|
296
296
|
autocoder/rag/raw_rag.py,sha256=BOr0YGf3umjqXOIDVO1LXQ0bIHx8hzBdiubND2ezyxc,2946
|
|
297
297
|
autocoder/rag/relevant_utils.py,sha256=25wRiX-CrBsratASLGHsZE3ux7VjwaQoDNtl74UlV5U,1749
|
|
298
298
|
autocoder/rag/searchable.py,sha256=miO2U-3J9JDYFOEv85vs9JExDQ0goLIeI20Ob2rNqU4,2067
|
|
@@ -359,9 +359,9 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
359
359
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
360
360
|
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=t902pKxQ5xM7zgIHiAOsTPLwxhE6VuvXAqPy751S7fg,14096
|
|
361
361
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
362
|
-
auto_coder-0.1.
|
|
363
|
-
auto_coder-0.1.
|
|
364
|
-
auto_coder-0.1.
|
|
365
|
-
auto_coder-0.1.
|
|
366
|
-
auto_coder-0.1.
|
|
367
|
-
auto_coder-0.1.
|
|
362
|
+
auto_coder-0.1.373.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
363
|
+
auto_coder-0.1.373.dist-info/METADATA,sha256=mL168k1XbVSt5qulwcxGwiUHRisywbZcR6s3FHRxXm8,2775
|
|
364
|
+
auto_coder-0.1.373.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
365
|
+
auto_coder-0.1.373.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
366
|
+
auto_coder-0.1.373.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
367
|
+
auto_coder-0.1.373.dist-info/RECORD,,
|
autocoder/agent/auto_tool.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from llama_index.core.agent import ReActAgent
|
|
2
|
-
from llama_index.core.tools import FunctionTool
|
|
3
1
|
from autocoder.pyproject import PyProject
|
|
4
2
|
from autocoder.tsproject import TSProject
|
|
5
3
|
from autocoder.suffixproject import SuffixProject
|
|
@@ -7,7 +5,6 @@ from autocoder.common import AutoCoderArgs
|
|
|
7
5
|
from autocoder.common.interpreter import Interpreter
|
|
8
6
|
from autocoder.common import ExecuteSteps, ExecuteStep, detect_env
|
|
9
7
|
from autocoder.common import code_auto_execute
|
|
10
|
-
from byzerllm.apps.llama_index.byzerai import ByzerAI
|
|
11
8
|
from loguru import logger
|
|
12
9
|
import os
|
|
13
10
|
import io
|
|
@@ -252,6 +249,8 @@ def get_tools(args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
|
252
249
|
|
|
253
250
|
console.print("[bold red]达到最大尝试次数,任务未能完成。[/bold red]")
|
|
254
251
|
return result
|
|
252
|
+
|
|
253
|
+
from llama_index.core.tools import FunctionTool
|
|
255
254
|
|
|
256
255
|
tools = [
|
|
257
256
|
FunctionTool.from_defaults(run_python_code),
|
|
@@ -284,6 +283,8 @@ class AutoTool:
|
|
|
284
283
|
return self.pp.get_tree_like_directory_structure.prompt()
|
|
285
284
|
|
|
286
285
|
def run(self, query: str, max_iterations: int = 20):
|
|
286
|
+
from byzerllm.apps.llama_index.byzerai import ByzerAI
|
|
287
|
+
from llama_index.core.agent import ReActAgent
|
|
287
288
|
agent = ReActAgent.from_tools(
|
|
288
289
|
tools=self.tools,
|
|
289
290
|
llm=ByzerAI(llm=self.code_model),
|
autocoder/agent/planner.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from llama_index.core.agent import ReActAgent
|
|
2
|
-
from llama_index.core.tools import FunctionTool
|
|
3
1
|
from autocoder.index.index import IndexManager
|
|
4
2
|
from autocoder.pyproject import PyProject
|
|
5
3
|
from autocoder.tsproject import TSProject
|
|
@@ -182,7 +180,8 @@ def get_tools(args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
|
182
180
|
args.collections = old_collections
|
|
183
181
|
|
|
184
182
|
return "\n".join([sc.source_code for sc in source_codes])
|
|
185
|
-
|
|
183
|
+
|
|
184
|
+
from llama_index.core.tools import FunctionTool
|
|
186
185
|
tools = [
|
|
187
186
|
FunctionTool.from_defaults(get_project_related_files),
|
|
188
187
|
FunctionTool.from_defaults(generate_auto_coder_yaml),
|
|
@@ -202,6 +201,7 @@ class Planner:
|
|
|
202
201
|
|
|
203
202
|
def run(self, query: str, max_iterations: int = 10):
|
|
204
203
|
from byzerllm.apps.llama_index.byzerai import ByzerAI
|
|
204
|
+
from llama_index.core.agent import ReActAgent
|
|
205
205
|
agent = ReActAgent.from_tools(
|
|
206
206
|
tools=self.tools,
|
|
207
207
|
llm=ByzerAI(llm=self.llm),
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from llama_index.core.agent import ReActAgent
|
|
2
|
-
from llama_index.core.tools import FunctionTool
|
|
3
1
|
from autocoder.index.index import IndexManager
|
|
4
2
|
from autocoder.pyproject import PyProject
|
|
5
3
|
from autocoder.tsproject import TSProject
|
|
@@ -176,7 +174,7 @@ def detect_rm_command(command: str) -> Bool:
|
|
|
176
174
|
|
|
177
175
|
|
|
178
176
|
def get_tools(args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
179
|
-
|
|
177
|
+
|
|
180
178
|
def ask_user(question:str) -> str:
|
|
181
179
|
'''
|
|
182
180
|
如果你对用户的问题有什么疑问,或者你想从用户收集一些额外信息,可以调用
|
|
@@ -404,7 +402,8 @@ def get_tools(args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
|
404
402
|
pass
|
|
405
403
|
|
|
406
404
|
return ",".join(matched_files)
|
|
407
|
-
|
|
405
|
+
|
|
406
|
+
from llama_index.core.tools import FunctionTool
|
|
408
407
|
tools = [
|
|
409
408
|
# FunctionTool.from_defaults(get_project_related_files),
|
|
410
409
|
FunctionTool.from_defaults(get_related_files_by_symbols),
|
|
@@ -440,6 +439,7 @@ class ProjectReader:
|
|
|
440
439
|
|
|
441
440
|
def run(self, query: str, max_iterations: int = 20):
|
|
442
441
|
from byzerllm.apps.llama_index.byzerai import ByzerAI
|
|
442
|
+
from llama_index.core.agent import ReActAgent
|
|
443
443
|
agent = ReActAgent.from_tools(
|
|
444
444
|
tools=self.tools,
|
|
445
445
|
llm=ByzerAI(llm=self.llm),
|
autocoder/chat_auto_coder.py
CHANGED
|
@@ -19,12 +19,11 @@ from autocoder.events.event_manager_singleton import gengerate_event_file_path
|
|
|
19
19
|
from autocoder.common.global_cancel import global_cancel
|
|
20
20
|
from autocoder.chat.models_command import handle_models_command
|
|
21
21
|
from autocoder.auto_coder_runner import (
|
|
22
|
-
auto_command,
|
|
23
|
-
load_memory,
|
|
24
|
-
save_memory,
|
|
22
|
+
auto_command,
|
|
25
23
|
configure, # Keep configure if it's used elsewhere or by handle_conf_command internally (though we adapted handle_conf_command not to)
|
|
26
24
|
# manage_models, # Removed
|
|
27
25
|
# print_conf, # Removed
|
|
26
|
+
save_memory,
|
|
28
27
|
exclude_dirs,
|
|
29
28
|
exclude_files,
|
|
30
29
|
ask,
|
|
@@ -122,10 +121,7 @@ def show_help():
|
|
|
122
121
|
)
|
|
123
122
|
print(
|
|
124
123
|
f" \033[94m/coding\033[0m \033[93m<query>\033[0m - \033[92m{get_message('coding_desc')}\033[0m"
|
|
125
|
-
)
|
|
126
|
-
print(
|
|
127
|
-
f" \033[94m/ask\033[0m \033[93m<query>\033[0m - \033[92m{get_message('ask_desc')}\033[0m"
|
|
128
|
-
)
|
|
124
|
+
)
|
|
129
125
|
print(
|
|
130
126
|
f" \033[94m/summon\033[0m \033[93m<query>\033[0m - \033[92m{get_message('summon_desc')}\033[0m"
|
|
131
127
|
)
|
|
@@ -302,7 +298,6 @@ def main():
|
|
|
302
298
|
# 加载保存的运行时配置
|
|
303
299
|
plugin_manager.load_runtime_cfg()
|
|
304
300
|
|
|
305
|
-
load_memory()
|
|
306
301
|
memory = get_memory()
|
|
307
302
|
|
|
308
303
|
configure(f"product_mode:{ARGS.product_mode}")
|
|
@@ -345,7 +340,8 @@ def main():
|
|
|
345
340
|
memory["mode"] = "voice_input"
|
|
346
341
|
else: # voice_input
|
|
347
342
|
memory["mode"] = "normal"
|
|
348
|
-
|
|
343
|
+
|
|
344
|
+
save_memory()
|
|
349
345
|
event.app.invalidate()
|
|
350
346
|
|
|
351
347
|
@kb.add("c-n")
|
|
@@ -467,8 +463,8 @@ def main():
|
|
|
467
463
|
else:
|
|
468
464
|
user_input = session.prompt(FormattedText(prompt_message), style=style)
|
|
469
465
|
new_prompt = ""
|
|
470
|
-
|
|
471
|
-
if "mode" not in memory:
|
|
466
|
+
|
|
467
|
+
if "mode" not in memory:
|
|
472
468
|
memory["mode"] = "auto_detect"
|
|
473
469
|
|
|
474
470
|
# 处理 user_input 的空格
|
|
@@ -545,9 +541,11 @@ def main():
|
|
|
545
541
|
print(memory["mode"])
|
|
546
542
|
else:
|
|
547
543
|
memory["mode"] = conf
|
|
544
|
+
save_memory()
|
|
548
545
|
|
|
549
546
|
elif user_input.startswith("/conf/export"):
|
|
550
547
|
from autocoder.common.conf_import_export import export_conf
|
|
548
|
+
export_conf(os.getcwd(), user_input[len("/conf/export") :].strip() or ".")
|
|
551
549
|
|
|
552
550
|
elif user_input.startswith("/plugins"):
|
|
553
551
|
# 提取命令参数并交由 plugin_manager 处理
|
|
@@ -580,14 +578,7 @@ def main():
|
|
|
580
578
|
|
|
581
579
|
elif user_input.startswith("/exclude_files"):
|
|
582
580
|
query = user_input[len("/exclude_files") :].strip()
|
|
583
|
-
exclude_files(query)
|
|
584
|
-
|
|
585
|
-
elif user_input.startswith("/ask"):
|
|
586
|
-
query = user_input[len("/ask") :].strip()
|
|
587
|
-
if not query:
|
|
588
|
-
print("Please enter your question.")
|
|
589
|
-
else:
|
|
590
|
-
ask(query)
|
|
581
|
+
exclude_files(query)
|
|
591
582
|
|
|
592
583
|
elif user_input.startswith("/exit"):
|
|
593
584
|
raise EOFError()
|
|
@@ -850,7 +850,8 @@ class AgenticEdit:
|
|
|
850
850
|
|
|
851
851
|
iteration_count = 0
|
|
852
852
|
tool_executed = False
|
|
853
|
-
|
|
853
|
+
should_yield_completion_event = False
|
|
854
|
+
completion_event = None
|
|
854
855
|
|
|
855
856
|
while True:
|
|
856
857
|
iteration_count += 1
|
|
@@ -859,12 +860,14 @@ class AgenticEdit:
|
|
|
859
860
|
last_message = conversations[-1]
|
|
860
861
|
if last_message["role"] == "assistant":
|
|
861
862
|
logger.info(f"Last message is assistant, skipping LLM interaction cycle")
|
|
862
|
-
if
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
863
|
+
if should_yield_completion_event:
|
|
864
|
+
if completion_event is None:
|
|
865
|
+
yield CompletionEvent(completion=AttemptCompletionTool(
|
|
866
|
+
result=last_message["content"],
|
|
867
|
+
command=""
|
|
868
|
+
), completion_xml="")
|
|
869
|
+
else:
|
|
870
|
+
yield completion_event
|
|
868
871
|
break
|
|
869
872
|
logger.info(
|
|
870
873
|
f"Starting LLM interaction cycle. History size: {len(conversations)}")
|
|
@@ -936,11 +939,12 @@ class AgenticEdit:
|
|
|
936
939
|
logger.info(
|
|
937
940
|
"AttemptCompletionTool received. Finalizing session.")
|
|
938
941
|
logger.info(f"Completion result: {tool_obj.result[:50]}...")
|
|
939
|
-
|
|
942
|
+
completion_event = CompletionEvent(completion=tool_obj, completion_xml=tool_xml)
|
|
940
943
|
logger.info(
|
|
941
944
|
"AgenticEdit analyze loop finished due to AttemptCompletion.")
|
|
942
945
|
save_formatted_log(self.args.source_dir, json.dumps(conversations, ensure_ascii=False), "agentic_conversation")
|
|
943
946
|
mark_event_should_finish = True
|
|
947
|
+
should_yield_completion_event = True
|
|
944
948
|
continue
|
|
945
949
|
|
|
946
950
|
if isinstance(tool_obj, PlanModeRespondTool):
|
|
@@ -13,7 +13,7 @@ from rich.console import Console
|
|
|
13
13
|
from rich.panel import Panel
|
|
14
14
|
from rich.text import Text
|
|
15
15
|
from autocoder.common.result_manager import ResultManager
|
|
16
|
-
|
|
16
|
+
from autocoder.common.printer import Printer
|
|
17
17
|
if typing.TYPE_CHECKING:
|
|
18
18
|
from autocoder.common.v2.agent.agentic_edit import AgenticEdit
|
|
19
19
|
|
|
@@ -22,6 +22,7 @@ class AskFollowupQuestionToolResolver(BaseToolResolver):
|
|
|
22
22
|
super().__init__(agent, tool, args)
|
|
23
23
|
self.tool: AskFollowupQuestionTool = tool # For type hinting
|
|
24
24
|
self.result_manager = ResultManager()
|
|
25
|
+
self.printer = Printer()
|
|
25
26
|
|
|
26
27
|
def resolve(self) -> ToolResult:
|
|
27
28
|
"""
|
autocoder/rag/llm_wrapper.py
CHANGED
|
@@ -7,7 +7,6 @@ import pydantic
|
|
|
7
7
|
from byzerllm import ByzerLLM
|
|
8
8
|
from byzerllm.utils.client import LLMResponse
|
|
9
9
|
from byzerllm.utils.types import SingleOutputMeta
|
|
10
|
-
from autocoder.rag.simple_rag import SimpleRAG
|
|
11
10
|
from autocoder.rag.long_context_rag import LongContextRAG
|
|
12
11
|
from loguru import logger
|
|
13
12
|
from byzerllm.utils.langutil import asyncfy_with_semaphore
|
|
@@ -15,7 +14,7 @@ from byzerllm.utils.langutil import asyncfy_with_semaphore
|
|
|
15
14
|
|
|
16
15
|
class LLWrapper:
|
|
17
16
|
|
|
18
|
-
def __init__(self, llm: ByzerLLM, rag: Union[
|
|
17
|
+
def __init__(self, llm: ByzerLLM, rag: Union[LongContextRAG]):
|
|
19
18
|
self.llm = llm
|
|
20
19
|
self.rag = rag
|
|
21
20
|
|
autocoder/rag/rag_entry.py
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
from typing import List, Dict, Any, Optional,Union
|
|
2
2
|
from autocoder.common import AutoCoderArgs, SourceCode
|
|
3
3
|
from byzerllm import ByzerLLM
|
|
4
|
-
from .simple_rag import SimpleRAG
|
|
5
4
|
from .long_context_rag import LongContextRAG
|
|
6
5
|
class RAGFactory:
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
@staticmethod
|
|
10
|
-
def get_rag(llm: ByzerLLM, args: AutoCoderArgs, path: str,**kargs) -> Union[
|
|
9
|
+
def get_rag(llm: ByzerLLM, args: AutoCoderArgs, path: str,**kargs) -> Union[LongContextRAG]:
|
|
11
10
|
"""
|
|
12
11
|
Factory method to get the appropriate RAG implementation based on arguments.
|
|
13
12
|
|
|
@@ -19,10 +18,7 @@ class RAGFactory:
|
|
|
19
18
|
Returns:
|
|
20
19
|
SimpleRAG or LongContextRAG: The appropriate RAG implementation.
|
|
21
20
|
"""
|
|
22
|
-
|
|
23
|
-
return LongContextRAG(llm, args, path,**kargs)
|
|
24
|
-
else:
|
|
25
|
-
return SimpleRAG(llm, args, path)
|
|
21
|
+
return LongContextRAG(llm, args, path,**kargs)
|
|
26
22
|
|
|
27
23
|
class RAGManager:
|
|
28
24
|
def __init__(self, llm: ByzerLLM, args: AutoCoderArgs, path: str):
|
autocoder/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
__version__ = "0.1.
|
|
2
|
+
__version__ = "0.1.373"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|