auto-coder 0.1.252__py3-none-any.whl → 0.1.254__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.252.dist-info → auto_coder-0.1.254.dist-info}/METADATA +1 -1
- {auto_coder-0.1.252.dist-info → auto_coder-0.1.254.dist-info}/RECORD +21 -21
- autocoder/auto_coder.py +4 -3
- autocoder/chat_auto_coder.py +20 -19
- autocoder/common/__init__.py +1 -0
- autocoder/common/code_auto_merge.py +1 -1
- autocoder/common/code_auto_merge_diff.py +1 -1
- autocoder/common/code_auto_merge_editblock.py +1 -1
- autocoder/common/code_auto_merge_strict_diff.py +1 -1
- autocoder/common/mcp_server.py +3 -4
- autocoder/common/mcp_servers/mcp_server_perplexity.py +1 -1
- autocoder/index/entry.py +9 -2
- autocoder/index/filter/quick_filter.py +58 -23
- autocoder/rag/doc_filter.py +3 -2
- autocoder/rag/long_context_rag.py +2 -15
- autocoder/utils/auto_coder_utils/chat_stream_out.py +28 -16
- autocoder/version.py +1 -1
- {auto_coder-0.1.252.dist-info → auto_coder-0.1.254.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.252.dist-info → auto_coder-0.1.254.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.252.dist-info → auto_coder-0.1.254.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.252.dist-info → auto_coder-0.1.254.dist-info}/top_level.txt +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
autocoder/auto_coder.py,sha256=
|
|
2
|
+
autocoder/auto_coder.py,sha256=KTc-twhc4MNabzgNWj8nDZZTD-uMneDABnFSWnt6Ta8,64640
|
|
3
3
|
autocoder/auto_coder_lang.py,sha256=Rtupq6N3_HT7JRhDKdgCBcwRaiAnyCOR_Gsp4jUomrI,3229
|
|
4
4
|
autocoder/auto_coder_rag.py,sha256=DDAmqw36CO6phtdQuN8LYIbIR3YGdoZw5-pG0LjVxMc,29063
|
|
5
5
|
autocoder/auto_coder_rag_client_mcp.py,sha256=WV7j5JUiQge0x4-B7Hp5-pSAFXLbvLpzQMcCovbauIM,6276
|
|
6
6
|
autocoder/auto_coder_rag_mcp.py,sha256=-RrjNwFaS2e5v8XDIrKR-zlUNUE8UBaeOtojffBrvJo,8521
|
|
7
7
|
autocoder/auto_coder_server.py,sha256=XU9b4SBH7zjPPXaTWWHV4_zJm-XYa6njuLQaplYJH_c,20290
|
|
8
8
|
autocoder/benchmark.py,sha256=Ypomkdzd1T3GE6dRICY3Hj547dZ6_inqJbBJIp5QMco,4423
|
|
9
|
-
autocoder/chat_auto_coder.py,sha256=
|
|
9
|
+
autocoder/chat_auto_coder.py,sha256=1QgTy6SiZjN2mkYe5pVvPTdZyedwijDctTUS8tSukVM,107527
|
|
10
10
|
autocoder/chat_auto_coder_lang.py,sha256=OiwjnOqbiWwbaVuOhehEqdUFPOJbhfvQr3sIq3b0xj4,17455
|
|
11
11
|
autocoder/command_args.py,sha256=9aYJ-AmPxP1sQh6ciw04FWHjSn31f2W9afXFwo8wgx4,30441
|
|
12
12
|
autocoder/lang.py,sha256=U6AjVV8Rs1uLyjFCZ8sT6WWuNUxMBqkXXIOs4S120uk,14511
|
|
13
13
|
autocoder/models.py,sha256=uo4mFWb-kdtd-8e2HPfCuXjhkDsE37n1dY6Nt1SU6kk,7625
|
|
14
|
-
autocoder/version.py,sha256=
|
|
14
|
+
autocoder/version.py,sha256=LLYeCF3eLt_aBS3HsiF4z5DiLpgabod5UhddNdga9mk,23
|
|
15
15
|
autocoder/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
autocoder/agent/auto_demand_organizer.py,sha256=NWSAEsEk94vT3lGjfo25kKLMwYdPcpy9e-i21txPasQ,6942
|
|
17
17
|
autocoder/agent/auto_filegroup.py,sha256=CW7bqp0FW1GIEMnl-blyAc2UGT7O9Mom0q66ITz1ckM,6635
|
|
@@ -25,7 +25,7 @@ autocoder/agent/project_reader.py,sha256=tWLaPoLw1gI6kO_NzivQj28KbobU2ceOLuppHMb
|
|
|
25
25
|
autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
26
|
autocoder/common/JupyterClient.py,sha256=O-wi6pXeAEYhAY24kDa0BINrLYvKS6rKyWe98pDClS0,2816
|
|
27
27
|
autocoder/common/ShellClient.py,sha256=fM1q8t_XMSbLBl2zkCNC2J9xuyKN3eXzGm6hHhqL2WY,2286
|
|
28
|
-
autocoder/common/__init__.py,sha256=
|
|
28
|
+
autocoder/common/__init__.py,sha256=6maackdzrYnUPvpgVPl92JdMOnw7X4n3EnEQA9OnLGE,11984
|
|
29
29
|
autocoder/common/anything2images.py,sha256=0ILBbWzY02M-CiWB-vzuomb_J1hVdxRcenAfIrAXq9M,25283
|
|
30
30
|
autocoder/common/anything2img.py,sha256=4TREa-sOA-iargieUy7MpyCYVUE-9Mmq0wJtwomPqnE,7662
|
|
31
31
|
autocoder/common/audio.py,sha256=Kn9nWKQddWnUrAz0a_ZUgjcu4VUU_IcZBigT7n3N3qc,7439
|
|
@@ -38,10 +38,10 @@ autocoder/common/code_auto_generate.py,sha256=N_kENWW4eVPKmihpIQ4Q2ivYkugAuCWIPL
|
|
|
38
38
|
autocoder/common/code_auto_generate_diff.py,sha256=QAm-BVJgGl_wbw0VjY2RZigVCwOBO-l1W-90PrYDdOQ,16741
|
|
39
39
|
autocoder/common/code_auto_generate_editblock.py,sha256=FuVH-sP4_Ys2MJk9SkWgHHLAKp51bKSxTwFzd7voilg,18356
|
|
40
40
|
autocoder/common/code_auto_generate_strict_diff.py,sha256=kieVUx2KuR0BGtQHE0Ll7i8e_3Lb4xfFXHIXDttQACE,15274
|
|
41
|
-
autocoder/common/code_auto_merge.py,sha256
|
|
42
|
-
autocoder/common/code_auto_merge_diff.py,sha256=
|
|
43
|
-
autocoder/common/code_auto_merge_editblock.py,sha256=
|
|
44
|
-
autocoder/common/code_auto_merge_strict_diff.py,sha256=
|
|
41
|
+
autocoder/common/code_auto_merge.py,sha256=-ksBjj4ZVcbY_tVH4JLXAMSRtsgaSxrSZ5-MOl9cAgE,7354
|
|
42
|
+
autocoder/common/code_auto_merge_diff.py,sha256=qpEuHJEgX6sWK7EDFEKqcYkyI28wOyM4pytyl8BLohY,15350
|
|
43
|
+
autocoder/common/code_auto_merge_editblock.py,sha256=sxgYMLMACRwJvw-bABkdDHezPelsDFrOCpGuhtT5Dzs,17504
|
|
44
|
+
autocoder/common/code_auto_merge_strict_diff.py,sha256=P0nKNkBrFMybTSZ7kOdA_JixoVmLCZIhAP5q7ILJ9j0,9538
|
|
45
45
|
autocoder/common/code_modification_ranker.py,sha256=qfadP9P-iiidCG2A_MjAf3Ca8cMz7YlnN08D_kH6uFc,6447
|
|
46
46
|
autocoder/common/command_completer.py,sha256=SSeb8MDH0JPvfdyW-S2uaHnui4VBDfSQvQPLbv3ORPA,9314
|
|
47
47
|
autocoder/common/command_generator.py,sha256=-hmbD_AnCa5HxL4BznuEfYAf_l8AxU5fAG5F0sM_fuE,2116
|
|
@@ -54,7 +54,7 @@ autocoder/common/image_to_page.py,sha256=O0cNO_vHHUP-fP4GXiVojShmNqkPnZXeIyiY1MR
|
|
|
54
54
|
autocoder/common/interpreter.py,sha256=62-dIakOunYB4yjmX8SHC0Gdy2h8NtxdgbpdqRZJ5vk,2833
|
|
55
55
|
autocoder/common/llm_rerank.py,sha256=FbvtCzaR661Mt2wn0qsuiEL1Y3puD6jeIJS4zg_e7Bs,3260
|
|
56
56
|
autocoder/common/mcp_hub.py,sha256=2ZyJv3Aiv4Y97UHut49oYhIFcu7ICR-mptDEBSgT3uE,14234
|
|
57
|
-
autocoder/common/mcp_server.py,sha256=
|
|
57
|
+
autocoder/common/mcp_server.py,sha256=1G6e0IbeS_h7CA1vr0dPAnf0o2H1f1A8I4bua8EUtKw,12318
|
|
58
58
|
autocoder/common/mcp_tools.py,sha256=KsLvRrB6pvmebqd-lDaSH6IBJR0AIxWRE-dtCEG_w9k,12485
|
|
59
59
|
autocoder/common/memory_manager.py,sha256=2ZjYG7BPyvbYalZBF6AM_G5e10Qkw_zrqtD4Zd7GSsQ,3663
|
|
60
60
|
autocoder/common/printer.py,sha256=P1WU0QjlfnjqTP5uA55GkHZCpFzRPFkc34DMMandreg,2023
|
|
@@ -68,7 +68,7 @@ autocoder/common/text.py,sha256=KGRQq314GHBmY4MWG8ossRoQi1_DTotvhxchpn78c-k,1003
|
|
|
68
68
|
autocoder/common/types.py,sha256=PXTETrsTvhLE49jqAeUKGySvxBN9pjeyCgRHLDYdd9U,664
|
|
69
69
|
autocoder/common/utils_code_auto_generate.py,sha256=kDW5B_2wRLk7hAls2hewliDacV86lrPz8Jan01BvtCw,3573
|
|
70
70
|
autocoder/common/mcp_servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
-
autocoder/common/mcp_servers/mcp_server_perplexity.py,sha256=
|
|
71
|
+
autocoder/common/mcp_servers/mcp_server_perplexity.py,sha256=IXTyMpd1CQcBLzVinA-_OIOHoNmbzvuW6pXIadaKHJE,5533
|
|
72
72
|
autocoder/data/tokenizer.json,sha256=7Lb5_DaYlDRvBRH0B0ynXO5c1fOwbQLxujX805-OEh0,7847602
|
|
73
73
|
autocoder/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
74
|
autocoder/db/store.py,sha256=tFT66bP2ZKIqZip-uhLkHRSLaaOAUUDZfozJwcqix3c,1908
|
|
@@ -80,21 +80,21 @@ autocoder/dispacher/actions/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
|
|
|
80
80
|
autocoder/dispacher/actions/plugins/action_regex_project.py,sha256=ckTbisMlvwMNHQbrt5WB7pBvf2XAhYQYGH8uyYrvGXU,6060
|
|
81
81
|
autocoder/dispacher/actions/plugins/action_translate.py,sha256=nVAtRSQpdGNmZxg1R_9zXG3AuTv3CHf2v7ODgj8u65c,7727
|
|
82
82
|
autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
83
|
-
autocoder/index/entry.py,sha256=
|
|
83
|
+
autocoder/index/entry.py,sha256=1KIGPCtxQN0OdErAco9OmGTd5hB8WJTpWGrxsGLsTcE,12634
|
|
84
84
|
autocoder/index/for_command.py,sha256=BFvljE4t6VaMBGboZAuhUCzVK0EitCy_n5D_7FEnihw,3204
|
|
85
85
|
autocoder/index/index.py,sha256=hVAIyF10N9hxKMWHA_ibYygGRZYJQZfZxRRrhQhrTvk,21225
|
|
86
86
|
autocoder/index/symbols_utils.py,sha256=CjcjUVajmJZB75Ty3a7kMv1BZphrm-tIBAdOJv6uo-0,2037
|
|
87
87
|
autocoder/index/types.py,sha256=a2s_KV5FJlq7jqA2ELSo9E1sjuLwDB-JJYMhSpzBAhU,596
|
|
88
88
|
autocoder/index/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
89
|
autocoder/index/filter/normal_filter.py,sha256=APu34iSvWhtlLtWgkj8N3Vo4oW1TegtZQq2bwDX_cs4,8031
|
|
90
|
-
autocoder/index/filter/quick_filter.py,sha256=
|
|
90
|
+
autocoder/index/filter/quick_filter.py,sha256=Dsm23Z_RrJ_UwCypGUPN1BlKUMibae_9_D8jWD1UDFw,10518
|
|
91
91
|
autocoder/pyproject/__init__.py,sha256=dQ2_7YZ7guybT9BhfxSGn43eLQJGQN2zgeKa6--JlaQ,14403
|
|
92
92
|
autocoder/rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
93
93
|
autocoder/rag/api_server.py,sha256=dRbhAZVRAOlZ64Cnxf4_rKb4iJwHnrWS9Zr67IVORw0,7288
|
|
94
|
-
autocoder/rag/doc_filter.py,sha256=
|
|
94
|
+
autocoder/rag/doc_filter.py,sha256=ZCixxUXNBbz6UiGbgXvbDWdn5moLac3HnZEphpasTDc,6579
|
|
95
95
|
autocoder/rag/document_retriever.py,sha256=5oThtxukGuRFF96o3pHKsk306a8diXbhgSrbqyU2BvM,8894
|
|
96
96
|
autocoder/rag/llm_wrapper.py,sha256=sbDxCANiZyWb_ocqNgqu2oy3c2t8orPNRGleEs-Uwl8,2649
|
|
97
|
-
autocoder/rag/long_context_rag.py,sha256=
|
|
97
|
+
autocoder/rag/long_context_rag.py,sha256=wmNmGsXN8RAFl6e9HaVzlwISXV9D-3bvf2qiaWjRy7w,24646
|
|
98
98
|
autocoder/rag/rag_config.py,sha256=8LwFcTd8OJWWwi1_WY4IzjqgtT6RyE2j4PjxS5cCTDE,802
|
|
99
99
|
autocoder/rag/rag_entry.py,sha256=6TKtErZ0Us9XSV6HgRKXA6yR3SiZGPHpynOKSaR1wgE,2463
|
|
100
100
|
autocoder/rag/raw_rag.py,sha256=yS2Ur6kG0IRjhCj2_VonwxjY_xls_E62jO5Gz5j2nqE,2952
|
|
@@ -142,11 +142,11 @@ autocoder/utils/tests.py,sha256=BqphrwyycGAvs-5mhH8pKtMZdObwhFtJ5MC_ZAOiLq8,1340
|
|
|
142
142
|
autocoder/utils/thread_utils.py,sha256=uXc9HEr1kSTi491lc-BhFUsbc0wb3ikltZNJkL7Ocz4,8195
|
|
143
143
|
autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
144
144
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
145
|
-
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=
|
|
145
|
+
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=xWXqICANbDOovH4wcFW1eSI7lB7TjXbk1mSU4bTKEW4,11434
|
|
146
146
|
autocoder/utils/chat_auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
147
|
-
auto_coder-0.1.
|
|
148
|
-
auto_coder-0.1.
|
|
149
|
-
auto_coder-0.1.
|
|
150
|
-
auto_coder-0.1.
|
|
151
|
-
auto_coder-0.1.
|
|
152
|
-
auto_coder-0.1.
|
|
147
|
+
auto_coder-0.1.254.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
148
|
+
auto_coder-0.1.254.dist-info/METADATA,sha256=a7eZ5YDrFy4_RSOLcTBzbdye35TnHukamLS-g3-jNkM,2616
|
|
149
|
+
auto_coder-0.1.254.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
150
|
+
auto_coder-0.1.254.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
151
|
+
auto_coder-0.1.254.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
152
|
+
auto_coder-0.1.254.dist-info/RECORD,,
|
autocoder/auto_coder.py
CHANGED
|
@@ -1109,8 +1109,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1109
1109
|
return
|
|
1110
1110
|
|
|
1111
1111
|
elif raw_args.agent_command == "chat":
|
|
1112
|
-
|
|
1113
|
-
|
|
1112
|
+
|
|
1114
1113
|
memory_dir = os.path.join(args.source_dir, ".auto-coder", "memory")
|
|
1115
1114
|
os.makedirs(memory_dir, exist_ok=True)
|
|
1116
1115
|
memory_file = os.path.join(memory_dir, "chat_history.json")
|
|
@@ -1335,6 +1334,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1335
1334
|
start_time = time.time()
|
|
1336
1335
|
|
|
1337
1336
|
if "rag" in args.action:
|
|
1337
|
+
from autocoder.rag.rag_entry import RAGFactory
|
|
1338
1338
|
args.enable_rag_search = True
|
|
1339
1339
|
args.enable_rag_context = False
|
|
1340
1340
|
rag = RAGFactory.get_rag(llm=chat_llm, args=args, path="")
|
|
@@ -1348,7 +1348,8 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1348
1348
|
response = mcp_server.send_request(
|
|
1349
1349
|
McpRequest(
|
|
1350
1350
|
query=args.query,
|
|
1351
|
-
model=args.inference_model or args.model
|
|
1351
|
+
model=args.inference_model or args.model,
|
|
1352
|
+
product_mode=args.product_mode
|
|
1352
1353
|
)
|
|
1353
1354
|
)
|
|
1354
1355
|
v = [[response.result,None]]
|
autocoder/chat_auto_coder.py
CHANGED
|
@@ -49,7 +49,7 @@ from autocoder.common.mcp_server import get_mcp_server, McpRequest, McpInstallRe
|
|
|
49
49
|
import byzerllm
|
|
50
50
|
from byzerllm.utils import format_str_jinja2
|
|
51
51
|
from autocoder.common.memory_manager import get_global_memory_file_paths
|
|
52
|
-
from autocoder import models
|
|
52
|
+
from autocoder import models as models_module
|
|
53
53
|
import shlex
|
|
54
54
|
from autocoder.utils.llms import get_single_llm
|
|
55
55
|
import pkg_resources
|
|
@@ -1539,11 +1539,12 @@ def mcp(query: str):
|
|
|
1539
1539
|
if os.path.exists(temp_yaml):
|
|
1540
1540
|
os.remove(temp_yaml)
|
|
1541
1541
|
|
|
1542
|
-
mcp_server = get_mcp_server()
|
|
1542
|
+
mcp_server = get_mcp_server()
|
|
1543
1543
|
response = mcp_server.send_request(
|
|
1544
1544
|
McpRequest(
|
|
1545
1545
|
query=query,
|
|
1546
|
-
model=args.inference_model or args.model
|
|
1546
|
+
model=args.inference_model or args.model,
|
|
1547
|
+
product_mode=args.product_mode
|
|
1547
1548
|
)
|
|
1548
1549
|
)
|
|
1549
1550
|
|
|
@@ -1564,19 +1565,19 @@ def mcp(query: str):
|
|
|
1564
1565
|
file_path = os.path.join(mcp_dir, f"{timestamp}.md")
|
|
1565
1566
|
|
|
1566
1567
|
# Format response as markdown
|
|
1567
|
-
markdown_content =
|
|
1568
|
+
markdown_content = response.result
|
|
1568
1569
|
|
|
1569
1570
|
# Save to file
|
|
1570
1571
|
with open(file_path, "w", encoding="utf-8") as f:
|
|
1571
1572
|
f.write(markdown_content)
|
|
1572
1573
|
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1574
|
+
console = Console()
|
|
1575
|
+
console.print(
|
|
1576
|
+
Panel(
|
|
1577
|
+
Markdown(markdown_content, justify="left"),
|
|
1578
|
+
title=printer.get_message_from_key('mcp_response_title'),
|
|
1579
|
+
border_style="green"
|
|
1580
|
+
)
|
|
1580
1581
|
)
|
|
1581
1582
|
|
|
1582
1583
|
|
|
@@ -1741,7 +1742,7 @@ def commit(query: str):
|
|
|
1741
1742
|
md5 = hashlib.md5(file_content.encode("utf-8")).hexdigest()
|
|
1742
1743
|
file_name = os.path.basename(execute_file)
|
|
1743
1744
|
commit_result = git_utils.commit_changes(
|
|
1744
|
-
".", f"auto_coder_{file_name}_{md5}"
|
|
1745
|
+
".", f"auto_coder_{file_name}_{md5}\n{commit_message}"
|
|
1745
1746
|
)
|
|
1746
1747
|
git_utils.print_commit_info(commit_result=commit_result)
|
|
1747
1748
|
if commit_message:
|
|
@@ -2173,7 +2174,7 @@ def manage_models(params, query: str):
|
|
|
2173
2174
|
printer.print_in_terminal("models_lite_only", style="red")
|
|
2174
2175
|
return
|
|
2175
2176
|
|
|
2176
|
-
models_data =
|
|
2177
|
+
models_data = models_module.load_models()
|
|
2177
2178
|
subcmd = ""
|
|
2178
2179
|
if "/list" in query:
|
|
2179
2180
|
subcmd = "/list"
|
|
@@ -2241,7 +2242,7 @@ def manage_models(params, query: str):
|
|
|
2241
2242
|
name = args[0]
|
|
2242
2243
|
try:
|
|
2243
2244
|
price = float(args[1])
|
|
2244
|
-
if
|
|
2245
|
+
if models_module.update_model_input_price(name, price):
|
|
2245
2246
|
printer.print_in_terminal("models_input_price_updated", style="green", name=name, price=price)
|
|
2246
2247
|
else:
|
|
2247
2248
|
printer.print_in_terminal("models_not_found", style="red", name=name)
|
|
@@ -2256,7 +2257,7 @@ def manage_models(params, query: str):
|
|
|
2256
2257
|
name = args[0]
|
|
2257
2258
|
try:
|
|
2258
2259
|
price = float(args[1])
|
|
2259
|
-
if
|
|
2260
|
+
if models_module.update_model_output_price(name, price):
|
|
2260
2261
|
printer.print_in_terminal("models_output_price_updated", style="green", name=name, price=price)
|
|
2261
2262
|
else:
|
|
2262
2263
|
printer.print_in_terminal("models_not_found", style="red", name=name)
|
|
@@ -2271,7 +2272,7 @@ def manage_models(params, query: str):
|
|
|
2271
2272
|
name = args[0]
|
|
2272
2273
|
try:
|
|
2273
2274
|
speed = float(args[1])
|
|
2274
|
-
if
|
|
2275
|
+
if models_module.update_model_speed(name, speed):
|
|
2275
2276
|
printer.print_in_terminal("models_speed_updated", style="green", name=name, speed=speed)
|
|
2276
2277
|
else:
|
|
2277
2278
|
printer.print_in_terminal("models_not_found", style="red", name=name)
|
|
@@ -2286,7 +2287,7 @@ def manage_models(params, query: str):
|
|
|
2286
2287
|
if len(args) == 2:
|
|
2287
2288
|
# Simplified: /models /add <name> <api_key>
|
|
2288
2289
|
name, api_key = args[0], args[1]
|
|
2289
|
-
result =
|
|
2290
|
+
result = models_module.update_model_with_api_key(name, api_key)
|
|
2290
2291
|
if result:
|
|
2291
2292
|
printer.print_in_terminal("models_added", style="green", name=name)
|
|
2292
2293
|
else:
|
|
@@ -2328,7 +2329,7 @@ def manage_models(params, query: str):
|
|
|
2328
2329
|
}
|
|
2329
2330
|
|
|
2330
2331
|
models_data.append(final_model)
|
|
2331
|
-
|
|
2332
|
+
models_module.save_models(models_data)
|
|
2332
2333
|
printer.print_in_terminal("models_add_model_success", style="green", name=data_dict["name"])
|
|
2333
2334
|
|
|
2334
2335
|
elif subcmd == "/remove":
|
|
@@ -2341,7 +2342,7 @@ def manage_models(params, query: str):
|
|
|
2341
2342
|
if len(filtered_models) == len(models_data):
|
|
2342
2343
|
printer.print_in_terminal("models_add_model_remove", style="yellow", name=name)
|
|
2343
2344
|
return
|
|
2344
|
-
|
|
2345
|
+
models_module.save_models(filtered_models)
|
|
2345
2346
|
printer.print_in_terminal("models_add_model_removed", style="green", name=name)
|
|
2346
2347
|
|
|
2347
2348
|
else:
|
autocoder/common/__init__.py
CHANGED
|
@@ -177,5 +177,5 @@ class CodeAutoMerge:
|
|
|
177
177
|
|
|
178
178
|
self.printer.print_in_terminal("files_merged", total=total)
|
|
179
179
|
if not force_skip_git:
|
|
180
|
-
commit_result = git_utils.commit_changes(self.args.source_dir, f"auto_coder_{file_name}_{md5}")
|
|
180
|
+
commit_result = git_utils.commit_changes(self.args.source_dir, f"auto_coder_{file_name}_{md5}\n{self.args.query}")
|
|
181
181
|
git_utils.print_commit_info(commit_result=commit_result)
|
|
@@ -523,5 +523,5 @@ class CodeAutoMergeDiff:
|
|
|
523
523
|
|
|
524
524
|
self.printer.print_in_terminal("files_merged_total", total=total)
|
|
525
525
|
if not force_skip_git:
|
|
526
|
-
commit_result = git_utils.commit_changes(self.args.source_dir, f"auto_coder_{file_name}_{md5}")
|
|
526
|
+
commit_result = git_utils.commit_changes(self.args.source_dir, f"auto_coder_{file_name}_{md5}\n{self.args.query}")
|
|
527
527
|
git_utils.print_commit_info(commit_result=commit_result)
|
|
@@ -403,7 +403,7 @@ class CodeAutoMergeEditBlock:
|
|
|
403
403
|
if not force_skip_git:
|
|
404
404
|
try:
|
|
405
405
|
commit_result = git_utils.commit_changes(
|
|
406
|
-
self.args.source_dir, f"auto_coder_{file_name}_{md5}"
|
|
406
|
+
self.args.source_dir, f"auto_coder_{file_name}_{md5}\n{self.args.query}"
|
|
407
407
|
)
|
|
408
408
|
git_utils.print_commit_info(commit_result=commit_result)
|
|
409
409
|
except Exception as e:
|
|
@@ -233,7 +233,7 @@ class CodeAutoMergeStrictDiff:
|
|
|
233
233
|
|
|
234
234
|
self.printer.print_in_terminal("files_merged_total", total=total)
|
|
235
235
|
if not force_skip_git:
|
|
236
|
-
commit_result = git_utils.commit_changes(self.args.source_dir, f"auto_coder_{file_name}_{md5}")
|
|
236
|
+
commit_result = git_utils.commit_changes(self.args.source_dir, f"auto_coder_{file_name}_{md5}\n{self.args.query}")
|
|
237
237
|
git_utils.print_commit_info(commit_result=commit_result)
|
|
238
238
|
|
|
239
239
|
@byzerllm.prompt(render="jinja2")
|
autocoder/common/mcp_server.py
CHANGED
|
@@ -3,7 +3,6 @@ from asyncio import Queue as AsyncQueue
|
|
|
3
3
|
import threading
|
|
4
4
|
from typing import List, Dict, Any, Optional
|
|
5
5
|
from dataclasses import dataclass
|
|
6
|
-
import byzerllm
|
|
7
6
|
from autocoder.common.mcp_hub import McpHub
|
|
8
7
|
from autocoder.common.mcp_tools import McpExecutor
|
|
9
8
|
from autocoder.common.mcp_hub import MCP_BUILD_IN_SERVERS
|
|
@@ -13,12 +12,13 @@ import time
|
|
|
13
12
|
from pydantic import BaseModel
|
|
14
13
|
import sys
|
|
15
14
|
from loguru import logger
|
|
15
|
+
from autocoder.utils.llms import get_single_llm
|
|
16
16
|
|
|
17
17
|
@dataclass
|
|
18
18
|
class McpRequest:
|
|
19
19
|
query: str
|
|
20
20
|
model: Optional[str] = None
|
|
21
|
-
|
|
21
|
+
product_mode: Optional[str] = None
|
|
22
22
|
|
|
23
23
|
@dataclass
|
|
24
24
|
class McpInstallRequest:
|
|
@@ -279,8 +279,7 @@ class McpServer:
|
|
|
279
279
|
await self._response_queue.put(McpResponse(result="", error=f"Failed to refresh MCP servers: {str(e)}"))
|
|
280
280
|
|
|
281
281
|
else:
|
|
282
|
-
llm =
|
|
283
|
-
model=request.model)
|
|
282
|
+
llm = get_single_llm(request.model,product_mode=request.product_mode)
|
|
284
283
|
mcp_executor = McpExecutor(hub, llm)
|
|
285
284
|
conversations = [
|
|
286
285
|
{"role": "user", "content": request.query}]
|
|
@@ -55,7 +55,7 @@ async def handle_list_tools() -> list[types.Tool]:
|
|
|
55
55
|
# Commenting out larger models,which have higher risks of timing out,
|
|
56
56
|
# until Claude Desktop can handle long-running tasks effectively.
|
|
57
57
|
# "llama-3.1-sonar-large-128k-online",
|
|
58
|
-
"
|
|
58
|
+
"sonar-reasoning-pro",
|
|
59
59
|
],
|
|
60
60
|
},
|
|
61
61
|
"messages": {
|
autocoder/index/entry.py
CHANGED
|
@@ -107,7 +107,13 @@ def build_index_and_filter_files(
|
|
|
107
107
|
model_name = "unknown(without default model name)"
|
|
108
108
|
printer.print_in_terminal("quick_filter_start", style="blue", model_name=model_name)
|
|
109
109
|
quick_filter = QuickFilter(index_manager,stats,sources)
|
|
110
|
-
|
|
110
|
+
quick_filter_result = quick_filter.filter(index_manager.read_index(),args.query)
|
|
111
|
+
if quick_filter_result.has_error:
|
|
112
|
+
raise KeyboardInterrupt(printer.get_message_from_key_with_format("quick_filter_failed",error=quick_filter_result.error_message))
|
|
113
|
+
|
|
114
|
+
# Merge quick filter results into final_files
|
|
115
|
+
final_files.update(quick_filter_result.files)
|
|
116
|
+
|
|
111
117
|
|
|
112
118
|
if not args.skip_filter_index and not args.index_filter_model:
|
|
113
119
|
model_name = getattr(index_manager.llm, 'default_model_name', None)
|
|
@@ -115,7 +121,8 @@ def build_index_and_filter_files(
|
|
|
115
121
|
model_name = "unknown(without default model name)"
|
|
116
122
|
printer.print_in_terminal("normal_filter_start", style="blue",model_name=model_name)
|
|
117
123
|
normal_filter = NormalFilter(index_manager,stats,sources)
|
|
118
|
-
|
|
124
|
+
# Merge normal filter results into final_files
|
|
125
|
+
final_files.update(normal_filter.filter(index_manager.read_index(),args.query))
|
|
119
126
|
|
|
120
127
|
|
|
121
128
|
def display_table_and_get_selections(data):
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from typing import List, Union, Dict, Any
|
|
1
|
+
from typing import List, Union, Dict, Any, Optional
|
|
2
|
+
from pydantic import BaseModel
|
|
2
3
|
from autocoder.utils.auto_coder_utils.chat_stream_out import stream_out
|
|
3
4
|
from autocoder.common.utils_code_auto_generate import stream_chat_with_continue
|
|
4
5
|
from byzerllm.utils.str2model import to_model
|
|
@@ -26,6 +27,11 @@ def get_file_path(file_path):
|
|
|
26
27
|
return file_path
|
|
27
28
|
|
|
28
29
|
|
|
30
|
+
class QuickFilterResult(BaseModel):
|
|
31
|
+
files: Dict[str, TargetFile]
|
|
32
|
+
has_error: bool
|
|
33
|
+
error_message: Optional[str] = None
|
|
34
|
+
|
|
29
35
|
class QuickFilter():
|
|
30
36
|
def __init__(self, index_manager: IndexManager,stats:Dict[str,Any],sources:List[SourceCode]):
|
|
31
37
|
self.index_manager = index_manager
|
|
@@ -36,11 +42,7 @@ class QuickFilter():
|
|
|
36
42
|
self.max_tokens = self.args.index_filter_model_max_input_length
|
|
37
43
|
|
|
38
44
|
|
|
39
|
-
def big_filter(self, index_items: List[IndexItem],) ->
|
|
40
|
-
|
|
41
|
-
final_files: Dict[str, TargetFile] = {}
|
|
42
|
-
final_files_lock = threading.Lock()
|
|
43
|
-
|
|
45
|
+
def big_filter(self, index_items: List[IndexItem],) -> QuickFilterResult:
|
|
44
46
|
chunks = []
|
|
45
47
|
current_chunk = []
|
|
46
48
|
|
|
@@ -70,9 +72,10 @@ class QuickFilter():
|
|
|
70
72
|
split_size=len(chunks)
|
|
71
73
|
)
|
|
72
74
|
|
|
73
|
-
def process_chunk(chunk_index: int, chunk: List[IndexItem]) ->
|
|
75
|
+
def process_chunk(chunk_index: int, chunk: List[IndexItem]) -> QuickFilterResult:
|
|
74
76
|
try:
|
|
75
77
|
model_name = ",".join(get_llm_names(self.index_manager.index_filter_llm))
|
|
78
|
+
files: Dict[str, TargetFile] = {}
|
|
76
79
|
|
|
77
80
|
if chunk_index == 0:
|
|
78
81
|
# 第一个chunk使用流式输出
|
|
@@ -93,13 +96,16 @@ class QuickFilter():
|
|
|
93
96
|
file_number_list = self.quick_filter_files.with_llm(self.index_manager.index_filter_llm).with_return_type(FileNumberList).run(chunk, self.args.query)
|
|
94
97
|
|
|
95
98
|
if file_number_list:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
for file_number in file_number_list.file_list:
|
|
100
|
+
file_path = get_file_path(chunk[file_number].module_name)
|
|
101
|
+
files[file_path] = TargetFile(
|
|
102
|
+
file_path=chunk[file_number].module_name,
|
|
103
|
+
reason=self.printer.get_message_from_key("quick_filter_reason")
|
|
104
|
+
)
|
|
105
|
+
return QuickFilterResult(
|
|
106
|
+
files=files,
|
|
107
|
+
has_error=False
|
|
108
|
+
)
|
|
103
109
|
|
|
104
110
|
except Exception as e:
|
|
105
111
|
self.printer.print_in_terminal(
|
|
@@ -107,18 +113,40 @@ class QuickFilter():
|
|
|
107
113
|
style="red",
|
|
108
114
|
error=str(e)
|
|
109
115
|
)
|
|
116
|
+
return QuickFilterResult(
|
|
117
|
+
files={},
|
|
118
|
+
has_error=True,
|
|
119
|
+
error_message=str(e)
|
|
120
|
+
)
|
|
110
121
|
|
|
122
|
+
results: List[QuickFilterResult] = []
|
|
111
123
|
if chunks:
|
|
112
124
|
with ThreadPoolExecutor() as executor:
|
|
113
|
-
# 提交所有chunks
|
|
125
|
+
# 提交所有chunks到线程池并收集结果
|
|
114
126
|
futures = [executor.submit(process_chunk, i, chunk)
|
|
115
127
|
for i, chunk in enumerate(chunks)]
|
|
116
128
|
|
|
117
|
-
#
|
|
129
|
+
# 等待所有任务完成并收集结果
|
|
118
130
|
for future in futures:
|
|
119
|
-
future.result()
|
|
120
|
-
|
|
121
|
-
|
|
131
|
+
results.append(future.result())
|
|
132
|
+
|
|
133
|
+
# 合并所有结果
|
|
134
|
+
final_files: Dict[str, TargetFile] = {}
|
|
135
|
+
has_error = False
|
|
136
|
+
error_messages: List[str] = []
|
|
137
|
+
|
|
138
|
+
for result in results:
|
|
139
|
+
if result.has_error:
|
|
140
|
+
has_error = True
|
|
141
|
+
if result.error_message:
|
|
142
|
+
error_messages.append(result.error_message)
|
|
143
|
+
final_files.update(result.files)
|
|
144
|
+
|
|
145
|
+
return QuickFilterResult(
|
|
146
|
+
files=final_files,
|
|
147
|
+
has_error=has_error,
|
|
148
|
+
error_message="\n".join(error_messages) if error_messages else None
|
|
149
|
+
)
|
|
122
150
|
|
|
123
151
|
@byzerllm.prompt()
|
|
124
152
|
def quick_filter_files(self,file_meta_list:List[IndexItem],query:str) -> str:
|
|
@@ -161,8 +189,8 @@ class QuickFilter():
|
|
|
161
189
|
}
|
|
162
190
|
return context
|
|
163
191
|
|
|
164
|
-
def filter(self, index_items: List[IndexItem], query: str) ->
|
|
165
|
-
final_files: Dict[str, TargetFile] = {}
|
|
192
|
+
def filter(self, index_items: List[IndexItem], query: str) -> QuickFilterResult:
|
|
193
|
+
final_files: Dict[str, TargetFile] = {}
|
|
166
194
|
start_time = time.monotonic()
|
|
167
195
|
|
|
168
196
|
prompt_str = self.quick_filter_files.prompt(index_items,query)
|
|
@@ -217,7 +245,11 @@ class QuickFilter():
|
|
|
217
245
|
style="red",
|
|
218
246
|
error=str(e)
|
|
219
247
|
)
|
|
220
|
-
return
|
|
248
|
+
return QuickFilterResult(
|
|
249
|
+
files=final_files,
|
|
250
|
+
has_error=True,
|
|
251
|
+
error_message=str(e)
|
|
252
|
+
)
|
|
221
253
|
|
|
222
254
|
if file_number_list:
|
|
223
255
|
for file_number in file_number_list.file_list:
|
|
@@ -227,4 +259,7 @@ class QuickFilter():
|
|
|
227
259
|
)
|
|
228
260
|
end_time = time.monotonic()
|
|
229
261
|
self.stats["timings"]["quick_filter"] = end_time - start_time
|
|
230
|
-
return
|
|
262
|
+
return QuickFilterResult(
|
|
263
|
+
files=final_files,
|
|
264
|
+
has_error=False
|
|
265
|
+
)
|
autocoder/rag/doc_filter.py
CHANGED
|
@@ -64,7 +64,7 @@ class DocFilter:
|
|
|
64
64
|
self.recall_llm = self.llm
|
|
65
65
|
|
|
66
66
|
self.args = args
|
|
67
|
-
self.relevant_score = self.args.rag_doc_filter_relevance
|
|
67
|
+
self.relevant_score = self.args.rag_doc_filter_relevance
|
|
68
68
|
self.on_ray = on_ray
|
|
69
69
|
self.path = path
|
|
70
70
|
|
|
@@ -140,6 +140,7 @@ class DocFilter:
|
|
|
140
140
|
f" - File: {doc.module_name}\n"
|
|
141
141
|
f" - Relevance: {'Relevant' if relevance and relevance.is_relevant else 'Not Relevant'}\n"
|
|
142
142
|
f" - Score: {relevance.relevant_score if relevance else 'N/A'}\n"
|
|
143
|
+
f" - Score Threshold: {self.relevant_score}\n"
|
|
143
144
|
f" - Raw Response: {v}\n"
|
|
144
145
|
f" - Timing:\n"
|
|
145
146
|
f" * Total Duration: {task_timing.duration:.2f}s\n"
|
|
@@ -148,7 +149,7 @@ class DocFilter:
|
|
|
148
149
|
)
|
|
149
150
|
if (
|
|
150
151
|
relevance
|
|
151
|
-
and relevance.is_relevant
|
|
152
|
+
# and relevance.is_relevant
|
|
152
153
|
and relevance.relevant_score >= self.relevant_score
|
|
153
154
|
):
|
|
154
155
|
relevant_docs.append(
|
|
@@ -439,7 +439,7 @@ class LongContextRAG:
|
|
|
439
439
|
|
|
440
440
|
logger.info(f"Query: {query} only_contexts: {only_contexts}")
|
|
441
441
|
start_time = time.time()
|
|
442
|
-
relevant_docs: List[FilterDoc] = self._filter_docs(conversations)
|
|
442
|
+
relevant_docs: List[FilterDoc] = self._filter_docs(conversations)
|
|
443
443
|
filter_time = time.time() - start_time
|
|
444
444
|
|
|
445
445
|
# Filter relevant_docs to only include those with is_relevant=True
|
|
@@ -449,20 +449,7 @@ class LongContextRAG:
|
|
|
449
449
|
|
|
450
450
|
if highly_relevant_docs:
|
|
451
451
|
relevant_docs = highly_relevant_docs
|
|
452
|
-
logger.info(f"Found {len(relevant_docs)} highly relevant documents")
|
|
453
|
-
else:
|
|
454
|
-
if relevant_docs:
|
|
455
|
-
prefix_chunk = FilterDoc(
|
|
456
|
-
source_code=SourceCode(
|
|
457
|
-
module_name="特殊说明",
|
|
458
|
-
source_code="没有找到特别相关的内容,下面的内容是一些不是很相关的文档。在根据后续文档回答问题前,你需要和用户先提前说一下。",
|
|
459
|
-
),
|
|
460
|
-
relevance=DocRelevance(False, 0),
|
|
461
|
-
)
|
|
462
|
-
relevant_docs.insert(0, prefix_chunk)
|
|
463
|
-
logger.info(
|
|
464
|
-
"No highly relevant documents found. Added a prefix chunk to indicate this."
|
|
465
|
-
)
|
|
452
|
+
logger.info(f"Found {len(relevant_docs)} highly relevant documents")
|
|
466
453
|
|
|
467
454
|
logger.info(
|
|
468
455
|
f"Filter time: {filter_time:.2f} seconds with {len(relevant_docs)} docs"
|
|
@@ -169,6 +169,10 @@ def stream_out(
|
|
|
169
169
|
keep_reasoning_content = True
|
|
170
170
|
if args:
|
|
171
171
|
keep_reasoning_content = args.keep_reasoning_content
|
|
172
|
+
|
|
173
|
+
keep_only_reasoning_content = False
|
|
174
|
+
if args:
|
|
175
|
+
keep_only_reasoning_content = args.keep_only_reasoning_content
|
|
172
176
|
|
|
173
177
|
lines_buffer = [] # 存储历史行
|
|
174
178
|
current_line = "" # 当前行
|
|
@@ -190,7 +194,10 @@ def stream_out(
|
|
|
190
194
|
break
|
|
191
195
|
last_meta = res[1]
|
|
192
196
|
content = res[0]
|
|
193
|
-
|
|
197
|
+
|
|
198
|
+
reasoning_content = ""
|
|
199
|
+
if last_meta:
|
|
200
|
+
reasoning_content = last_meta.reasoning_content
|
|
194
201
|
|
|
195
202
|
if reasoning_content == "" and content == "":
|
|
196
203
|
continue
|
|
@@ -198,21 +205,24 @@ def stream_out(
|
|
|
198
205
|
if first_token_time == 0.0:
|
|
199
206
|
first_token_time = time.time() - first_token_time_start
|
|
200
207
|
|
|
201
|
-
if
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
if keep_only_reasoning_content:
|
|
209
|
+
assistant_response += reasoning_content
|
|
210
|
+
else:
|
|
211
|
+
if keep_reasoning_content:
|
|
212
|
+
# 处理思考内容
|
|
213
|
+
if reasoning_content:
|
|
214
|
+
if assistant_response == "": # 首次遇到思考内容时添加开标签
|
|
215
|
+
assistant_response = "<thinking>"
|
|
216
|
+
assistant_response += reasoning_content
|
|
217
|
+
|
|
218
|
+
# 处理正式内容
|
|
219
|
+
if content:
|
|
220
|
+
# 如果之前有思考内容,需要先关闭thinking标签
|
|
221
|
+
if "</thinking>" not in assistant_response and "<thinking>" in assistant_response:
|
|
222
|
+
assistant_response += "</thinking>"
|
|
223
|
+
assistant_response += content
|
|
224
|
+
else:
|
|
213
225
|
assistant_response += content
|
|
214
|
-
else:
|
|
215
|
-
assistant_response += content
|
|
216
226
|
|
|
217
227
|
display_delta = reasoning_content if reasoning_content else content
|
|
218
228
|
|
|
@@ -291,5 +301,7 @@ def stream_out(
|
|
|
291
301
|
status=RequestOption.COMPLETED
|
|
292
302
|
),
|
|
293
303
|
)
|
|
294
|
-
|
|
304
|
+
|
|
305
|
+
if last_meta:
|
|
306
|
+
last_meta.first_token_time = first_token_time
|
|
295
307
|
return assistant_response, last_meta
|
autocoder/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.254"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|