auto-coder 0.1.373__py3-none-any.whl → 0.1.375__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.373.dist-info → auto_coder-0.1.375.dist-info}/METADATA +2 -2
- {auto_coder-0.1.373.dist-info → auto_coder-0.1.375.dist-info}/RECORD +27 -23
- autocoder/agent/base_agentic/base_agent.py +193 -44
- autocoder/agent/base_agentic/default_tools.py +38 -6
- autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +83 -43
- autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +88 -25
- autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +171 -62
- autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +101 -56
- autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py +5 -0
- autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py +5 -0
- autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +145 -32
- autocoder/auto_coder_rag.py +68 -11
- autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +47 -141
- autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py +47 -102
- autocoder/index/index.py +1 -1
- autocoder/linters/linter_factory.py +4 -1
- autocoder/linters/normal_linter.py +2 -4
- autocoder/linters/python_linter.py +18 -115
- autocoder/rag/agentic_rag.py +217 -0
- autocoder/rag/tools/__init__.py +10 -0
- autocoder/rag/tools/recall_tool.py +162 -0
- autocoder/rag/tools/search_tool.py +125 -0
- autocoder/version.py +1 -1
- {auto_coder-0.1.373.dist-info → auto_coder-0.1.375.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.373.dist-info → auto_coder-0.1.375.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.373.dist-info → auto_coder-0.1.375.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.373.dist-info → auto_coder-0.1.375.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.375
|
|
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.185
|
|
32
32
|
Requires-Dist: patch
|
|
33
33
|
Requires-Dist: diff-match-patch
|
|
34
34
|
Requires-Dist: GitPython
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
autocoder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
autocoder/auto_coder.py,sha256=7602L3tG0JErNxh8vkLAmGUgv2c-DGPzPCkmWIQt9bs,69757
|
|
3
3
|
autocoder/auto_coder_lang.py,sha256=Rtupq6N3_HT7JRhDKdgCBcwRaiAnyCOR_Gsp4jUomrI,3229
|
|
4
|
-
autocoder/auto_coder_rag.py,sha256=
|
|
4
|
+
autocoder/auto_coder_rag.py,sha256=MqIYTuBtrosl7u-jzpyVg7SGUI7pOOV2AonPHLD-XLY,40530
|
|
5
5
|
autocoder/auto_coder_rag_client_mcp.py,sha256=QRxUbjc6A8UmDMQ8lXgZkjgqtq3lgKYeatJbDY6rSo0,6270
|
|
6
6
|
autocoder/auto_coder_rag_mcp.py,sha256=-RrjNwFaS2e5v8XDIrKR-zlUNUE8UBaeOtojffBrvJo,8521
|
|
7
7
|
autocoder/auto_coder_runner.py,sha256=VktQIEWjVMmraVjD7W73eZmYtdfm9Ma2w_Ib-cWZYhM,112263
|
|
@@ -14,7 +14,7 @@ autocoder/command_parser.py,sha256=fx1g9E6GaM273lGTcJqaFQ-hoksS_Ik2glBMnVltPCE,1
|
|
|
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=6vZYCHwMaZZEW6PYDqmtmzTZTvSqPxxfOk9Z-_SAVxQ,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
|
|
@@ -47,8 +47,8 @@ autocoder/agent/base_agentic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
47
47
|
autocoder/agent/base_agentic/agent_hub.py,sha256=3Al9rCKu-SRgAs1kvnMe4VIIErTIw85QTkhfFu5omO8,5605
|
|
48
48
|
autocoder/agent/base_agentic/agentic_lang.py,sha256=UCq1NY9USaYJakTWc-3cv_MeHxAb6se1PI4lsSwGrPM,3657
|
|
49
49
|
autocoder/agent/base_agentic/agentic_tool_display.py,sha256=UnAq8ovvpu88KLk19Ff0TW-Dq-k7YiRwZiIJgcYPwiY,6989
|
|
50
|
-
autocoder/agent/base_agentic/base_agent.py,sha256=
|
|
51
|
-
autocoder/agent/base_agentic/default_tools.py,sha256=
|
|
50
|
+
autocoder/agent/base_agentic/base_agent.py,sha256=X7bX5WbWT53TnHYKXry2pmuPLXPdoLrqoRGFG9yVvCE,93170
|
|
51
|
+
autocoder/agent/base_agentic/default_tools.py,sha256=gCzw6pJA95ERXWwSlAm1SVxmzAvJmi-O6nrmLcNStCc,34200
|
|
52
52
|
autocoder/agent/base_agentic/test_base_agent.py,sha256=jok9f-DoEagzZRWjk-Zpy3gKw2ztZrsNzEc0XlvE7HU,2804
|
|
53
53
|
autocoder/agent/base_agentic/tool_registry.py,sha256=YFnUXJ78y7g3pm3yGgrhZ-0mx-C1ctdcA0r_ljGiE6o,14292
|
|
54
54
|
autocoder/agent/base_agentic/types.py,sha256=y9BvgN1a38EWB3cIGYTgxPYsrHql09HyqdFmL7e76jQ,4159
|
|
@@ -59,15 +59,15 @@ autocoder/agent/base_agentic/tools/attempt_completion_tool_resolver.py,sha256=9a
|
|
|
59
59
|
autocoder/agent/base_agentic/tools/base_tool_resolver.py,sha256=Y0PmRPhBLLdZpr2DNV0W5goGfAqylM5m1bHxa3T6vAY,1009
|
|
60
60
|
autocoder/agent/base_agentic/tools/example_tool_resolver.py,sha256=8WBIqEH_76S0iBHBM3RhLkk14UpJ28lRAw6dNUT-0no,1388
|
|
61
61
|
autocoder/agent/base_agentic/tools/execute_command_tool_resolver.py,sha256=FDWheOy2NVG1RDeG2lhMlj0cFjG4UpqCkWPRMEM7Atc,3755
|
|
62
|
-
autocoder/agent/base_agentic/tools/list_files_tool_resolver.py,sha256=
|
|
62
|
+
autocoder/agent/base_agentic/tools/list_files_tool_resolver.py,sha256=SCAYAiqmgwuCLMwRwroUQFfVS_hbcuAoG9-jIJxiB1c,8061
|
|
63
63
|
autocoder/agent/base_agentic/tools/plan_mode_respond_tool_resolver.py,sha256=hiLdMRknR_Aljd7Ic2bOWZKs11aFHdhkRTKTlP3IIgw,1461
|
|
64
|
-
autocoder/agent/base_agentic/tools/read_file_tool_resolver.py,sha256=
|
|
65
|
-
autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py,sha256=
|
|
66
|
-
autocoder/agent/base_agentic/tools/search_files_tool_resolver.py,sha256=
|
|
67
|
-
autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py,sha256=
|
|
68
|
-
autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py,sha256=
|
|
64
|
+
autocoder/agent/base_agentic/tools/read_file_tool_resolver.py,sha256=egcxrXv32stvhB3QawE2k62-9W5U3TNuY3qoTyKKhs0,5076
|
|
65
|
+
autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py,sha256=rc1tVaCMfhtpB0qxep4SBFSklRYHgfOATEPlIEFT_G8,12745
|
|
66
|
+
autocoder/agent/base_agentic/tools/search_files_tool_resolver.py,sha256=cMcfA_3swonPvQiDl_73fPgcQgr5BaUVwMJfj2Btqak,9528
|
|
67
|
+
autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py,sha256=uf_KGvL4xo6Aj4D03xvR95jpF6nzpSsymb7D74mMqBI,3549
|
|
68
|
+
autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py,sha256=1uEtR2e0Eq5ckOPqHn6K0BKgyZL6Lk-BP0V4-awvNhg,2790
|
|
69
69
|
autocoder/agent/base_agentic/tools/use_mcp_tool_resolver.py,sha256=Ph63zm6973nxRdRINV3ME0rhDWqtaEveHqLjEEMN02I,1554
|
|
70
|
-
autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py,sha256=
|
|
70
|
+
autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py,sha256=ZvNt6HIBHo0KhYbrGa_-2LOntjsXFKUIrmy8V-rIMfs,7996
|
|
71
71
|
autocoder/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
72
|
autocoder/chat/conf_command.py,sha256=sqsZEjFXUCaCydXbqLU_ockpwQ7efQCicEd-hjD29ts,11353
|
|
73
73
|
autocoder/chat/models_command.py,sha256=yISjvqNbKHVapGcXMcsIwRFfPruJ5ruSqR_e8TqhaPw,20105
|
|
@@ -207,12 +207,12 @@ autocoder/common/v2/agent/agentic_edit_tools/list_files_tool_resolver.py,sha256=
|
|
|
207
207
|
autocoder/common/v2/agent/agentic_edit_tools/list_package_info_tool_resolver.py,sha256=dIdV12VuczHpHuHgx2B1j_3BZYc9PL0jfHCuBk9ryk8,2005
|
|
208
208
|
autocoder/common/v2/agent/agentic_edit_tools/plan_mode_respond_tool_resolver.py,sha256=lGT4_QYJK6Fa9f6HVSGo0cSsGK7qCsDYgJGUowNxPzk,1499
|
|
209
209
|
autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py,sha256=6JhjM3VXV3BGelh1dNcdr-M5FoVPoqLkls1-y8ND8_c,6721
|
|
210
|
-
autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py,sha256=
|
|
210
|
+
autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py,sha256=ZTdImTBK7KTYH98JVUioBNtIz-dqSfhkmNEBhajt7hk,12686
|
|
211
211
|
autocoder/common/v2/agent/agentic_edit_tools/search_files_tool_resolver.py,sha256=VtDRDFJ2qzACy2jpD1ZNhywgCT3_iYUmGoUhHHmMX3o,9581
|
|
212
212
|
autocoder/common/v2/agent/agentic_edit_tools/test_search_files_tool_resolver.py,sha256=9eBo3WLkrr77iNotwIwVmH1ZL3UY0JQgLpdAIc9wTTM,6127
|
|
213
213
|
autocoder/common/v2/agent/agentic_edit_tools/test_write_to_file_tool_resolver.py,sha256=ZWRPsJny_My4UMzovrB8J2_x5N0rEW-xx3DVI-kDRFI,15870
|
|
214
214
|
autocoder/common/v2/agent/agentic_edit_tools/use_mcp_tool_resolver.py,sha256=wM2Xy4bcnD0TSLEmcM8rvvyyWenN5_KQnJMO6hJ8lTE,1716
|
|
215
|
-
autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py,sha256=
|
|
215
|
+
autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py,sha256=lPESPLoe9P_bEXXNqqHAkVlqMrIH0XziJ6XeILIejUo,8084
|
|
216
216
|
autocoder/compilers/__init__.py,sha256=C0HOms70QA747XD0uZEMmGtRFcIPenohyqECNStv0Bw,1647
|
|
217
217
|
autocoder/compilers/base_compiler.py,sha256=dsTzMO4H_RoqWfE-SntIk2B52hWuvSlWVLtkdCbHgGs,3244
|
|
218
218
|
autocoder/compilers/compiler_config_api.py,sha256=QRSwWm_EX7jSeZ3dtQqM9HI__x5aZ7U0c3fHIW_2N48,13839
|
|
@@ -252,7 +252,7 @@ autocoder/ignorefiles/test_ignore_file_utils.py,sha256=961_5ilCgzyo09Luj457A4694
|
|
|
252
252
|
autocoder/index/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
253
253
|
autocoder/index/entry.py,sha256=Eb0SmwrgshQte3_IGL4GAB4_HXC2jbatrgrd2uPxQng,15306
|
|
254
254
|
autocoder/index/for_command.py,sha256=BFvljE4t6VaMBGboZAuhUCzVK0EitCy_n5D_7FEnihw,3204
|
|
255
|
-
autocoder/index/index.py,sha256=
|
|
255
|
+
autocoder/index/index.py,sha256=xHm9jrAGy3qErS6GlUli3uFaEzHu_PZLjda8Sp0i0hw,33234
|
|
256
256
|
autocoder/index/symbols_utils.py,sha256=_EP7E_qWXxluAxq3FGZLlLfdrfwx3FmxCdulI8VGuac,2244
|
|
257
257
|
autocoder/index/types.py,sha256=a2s_KV5FJlq7jqA2ELSo9E1sjuLwDB-JJYMhSpzBAhU,596
|
|
258
258
|
autocoder/index/filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -261,10 +261,10 @@ autocoder/index/filter/quick_filter.py,sha256=ozESEgy506FQ5ecjOumyo4D_KMrterB1QL
|
|
|
261
261
|
autocoder/linters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
262
262
|
autocoder/linters/base_linter.py,sha256=1_0DPESnSyF3ZcQhoFkBYJylT5w-B61Rx-3A9uhuPlg,3066
|
|
263
263
|
autocoder/linters/code_linter.py,sha256=JylTj-Mj4jl9-XSH3PVlbQ4l55Y6E1FG-glv860CGSs,22462
|
|
264
|
-
autocoder/linters/linter_factory.py,sha256=
|
|
264
|
+
autocoder/linters/linter_factory.py,sha256=BgGeXPdli7BgiN9BifWoosyn9BGeJnRwSqX0G1R8qvU,10471
|
|
265
265
|
autocoder/linters/models.py,sha256=GBdayu_p50KBxoRms4X68zrDK-OsKDEKKjo926FevwE,9838
|
|
266
|
-
autocoder/linters/normal_linter.py,sha256=
|
|
267
|
-
autocoder/linters/python_linter.py,sha256=
|
|
266
|
+
autocoder/linters/normal_linter.py,sha256=ezToVW33psvBXsGhE7y1ng7ucf7yT_1YuIULns6TXYM,13011
|
|
267
|
+
autocoder/linters/python_linter.py,sha256=vs6cyN77q4HeiBvFbVBzMpL9H75wwskJk5WXjgIPw64,18963
|
|
268
268
|
autocoder/linters/reactjs_linter.py,sha256=LDCXmAI15LUq8nNPyYko3oryzCc2Su05ob63jEeDdIs,20815
|
|
269
269
|
autocoder/linters/shadow_linter.py,sha256=SKgRNVnTavNUviFC9osYMz18nGWCVOPOHx9LavEbnmc,15047
|
|
270
270
|
autocoder/linters/vue_linter.py,sha256=ZyvoxT0kSizFh_UkR7UZYO5DV9edbvDQZaibEF9W95I,20905
|
|
@@ -283,6 +283,7 @@ autocoder/privacy/__init__.py,sha256=LnIVvGu_K66zCE-yhN_-dPO8R80pQyedCsXJ7wRqQaI
|
|
|
283
283
|
autocoder/privacy/model_filter.py,sha256=RyGh_uWWE6hHqvaYZGjFylDJldDLxBz5LDZP7CG3sTo,14178
|
|
284
284
|
autocoder/pyproject/__init__.py,sha256=qn0_-6O_LP-ZH91nneYrn3yaIMYCYYRD1Z3MSNhXUXI,13754
|
|
285
285
|
autocoder/rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
286
|
+
autocoder/rag/agentic_rag.py,sha256=v9UuihbUXcQLXi1u_WLPhtZIzKigHJNQot8DpcAV4Zc,8344
|
|
286
287
|
autocoder/rag/api_server.py,sha256=TNN5CmR1nlMgeuZVYZ1U3a48XBp647Io9P-VvCkdI9o,13936
|
|
287
288
|
autocoder/rag/conversation_to_queries.py,sha256=xwmErn4WbdADnhK1me-h_6fV3KYrl_y1qPNQl1aoI6o,4810
|
|
288
289
|
autocoder/rag/doc_filter.py,sha256=UduVO2mlrngwJICrefjDJTYfdmQ4GcRXrfWDQ7xXksk,14206
|
|
@@ -329,6 +330,9 @@ autocoder/rag/loaders/test_image_loader.py,sha256=oy_j8xkFgPZ0vhz6czTVPh7IwdVWkg
|
|
|
329
330
|
autocoder/rag/stream_event/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
330
331
|
autocoder/rag/stream_event/event_writer.py,sha256=l7kq_LnDDE8E5dZ-73C7J2MgzSL7WrozdXk0eV-k55Q,409
|
|
331
332
|
autocoder/rag/stream_event/types.py,sha256=rtLwOE8rShmi1dJdxyBpAV5ZjLBGG9vptMiSzMxGuIA,318
|
|
333
|
+
autocoder/rag/tools/__init__.py,sha256=3U91ZI4wZh8UYYl_D11IyLxBLseemmPVfBnmh4ZzNgw,376
|
|
334
|
+
autocoder/rag/tools/recall_tool.py,sha256=ChnZFVrAYO4mpErhn4eQaizzz2Hve0ZDULVN8eeQv14,6456
|
|
335
|
+
autocoder/rag/tools/search_tool.py,sha256=tfLvz-e7XkO-FBz3OvKvgaXJn8t6s9AVB_KEayh9nOE,4671
|
|
332
336
|
autocoder/regex_project/__init__.py,sha256=EBZeCL5ORyD_9_5u_UuG4s7XtpXOu0y1sWDmxWFtufE,6781
|
|
333
337
|
autocoder/regexproject/__init__.py,sha256=QMXphSxjuv_LDIx0L_0jnnvCzMfmrOl0VMTVmXabeL0,8976
|
|
334
338
|
autocoder/shadows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -359,9 +363,9 @@ autocoder/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
359
363
|
autocoder/utils/auto_coder_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
360
364
|
autocoder/utils/auto_coder_utils/chat_stream_out.py,sha256=t902pKxQ5xM7zgIHiAOsTPLwxhE6VuvXAqPy751S7fg,14096
|
|
361
365
|
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.
|
|
366
|
+
auto_coder-0.1.375.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
367
|
+
auto_coder-0.1.375.dist-info/METADATA,sha256=VkKAuKh-MDeRogQZriF1Cc7L_J5VqjJmIYG8pVXG2hA,2775
|
|
368
|
+
auto_coder-0.1.375.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
369
|
+
auto_coder-0.1.375.dist-info/entry_points.txt,sha256=0nzHtHH4pNcM7xq4EBA2toS28Qelrvcbrr59GqD_0Ak,350
|
|
370
|
+
auto_coder-0.1.375.dist-info/top_level.txt,sha256=Jqc0_uJSw2GwoFQAa9iJxYns-2mWla-9ok_Y3Gcznjk,10
|
|
371
|
+
auto_coder-0.1.375.dist-info/RECORD,,
|
|
@@ -24,7 +24,7 @@ from autocoder.common.printer import Printer
|
|
|
24
24
|
from autocoder.utils.auto_project_type import ProjectTypeAnalyzer
|
|
25
25
|
from autocoder.common.mcp_server import get_mcp_server, McpServerInfoRequest
|
|
26
26
|
from autocoder.common.file_monitor.monitor import FileMonitor
|
|
27
|
-
from autocoder.common.rulefiles.autocoderrules_utils import
|
|
27
|
+
from autocoder.common.rulefiles.autocoderrules_utils import get_required_and_index_rules
|
|
28
28
|
from autocoder.auto_coder_runner import load_tokenizer
|
|
29
29
|
from autocoder.linters.shadow_linter import ShadowLinter
|
|
30
30
|
from autocoder.compilers.shadow_compiler import ShadowCompiler
|
|
@@ -34,6 +34,10 @@ from autocoder.events.event_types import Event, EventType, EventMetadata
|
|
|
34
34
|
from autocoder.events import event_content as EventContentCreator
|
|
35
35
|
from autocoder.memory.active_context_manager import ActiveContextManager
|
|
36
36
|
from autocoder.common.action_yml_file_manager import ActionYmlFileManager
|
|
37
|
+
from autocoder.common.file_checkpoint.models import FileChange as CheckpointFileChange
|
|
38
|
+
from autocoder.common.file_checkpoint.manager import FileChangeManager as CheckpointFileChangeManager
|
|
39
|
+
from autocoder.linters.normal_linter import NormalLinter
|
|
40
|
+
from autocoder.compilers.normal_compiler import NormalCompiler
|
|
37
41
|
|
|
38
42
|
from .types import (
|
|
39
43
|
BaseTool, ToolResult, AgentRequest, FileChangeEntry,
|
|
@@ -64,6 +68,7 @@ class BaseAgent(ABC):
|
|
|
64
68
|
files: SourceCodeList,
|
|
65
69
|
args: AutoCoderArgs,
|
|
66
70
|
conversation_history: Optional[List[Dict[str, Any]]] = None,
|
|
71
|
+
default_tools_list: Optional[List[str]] = None
|
|
67
72
|
):
|
|
68
73
|
"""
|
|
69
74
|
初始化代理
|
|
@@ -102,9 +107,21 @@ class BaseAgent(ABC):
|
|
|
102
107
|
|
|
103
108
|
# 5. 初始化其他组件
|
|
104
109
|
self.project_type_analyzer = ProjectTypeAnalyzer(args=args, llm=self.llm)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
self.
|
|
110
|
+
# self.shadow_manager = ShadowManager(
|
|
111
|
+
# args.source_dir, args.event_file, args.ignore_clean_shadows)
|
|
112
|
+
self.shadow_manager = None
|
|
113
|
+
# self.shadow_linter = ShadowLinter(self.shadow_manager, verbose=False)
|
|
114
|
+
self.shadow_compiler = None
|
|
115
|
+
# self.shadow_compiler = ShadowCompiler(self.shadow_manager, verbose=False)
|
|
116
|
+
self.shadow_linter = None
|
|
117
|
+
|
|
118
|
+
self.checkpoint_manager = CheckpointFileChangeManager(
|
|
119
|
+
project_dir=args.source_dir,
|
|
120
|
+
backup_dir=os.path.join(args.source_dir,".auto-coder","checkpoint"),
|
|
121
|
+
store_dir=os.path.join(args.source_dir,".auto-coder","checkpoint_store"),
|
|
122
|
+
max_history=50)
|
|
123
|
+
self.linter = NormalLinter(args.source_dir,verbose=False)
|
|
124
|
+
self.compiler = NormalCompiler(args.source_dir,verbose=False)
|
|
108
125
|
|
|
109
126
|
|
|
110
127
|
|
|
@@ -138,7 +155,7 @@ class BaseAgent(ABC):
|
|
|
138
155
|
self._chat_lock = threading.RLock() # 保护 private_chats
|
|
139
156
|
# 自动注册到AgentHub
|
|
140
157
|
AgentHub.register_agent(self)
|
|
141
|
-
register_default_tools(params=self._render_context())
|
|
158
|
+
register_default_tools(params=self._render_context(), default_tools_list=default_tools_list)
|
|
142
159
|
|
|
143
160
|
|
|
144
161
|
def who_am_i(self, role: str) -> 'BaseAgent':
|
|
@@ -536,28 +553,7 @@ class BaseAgent(ABC):
|
|
|
536
553
|
|
|
537
554
|
{{ case_info.doc }}
|
|
538
555
|
{% endfor %}
|
|
539
|
-
|
|
540
|
-
====
|
|
541
|
-
|
|
542
|
-
ACT MODE V.S. PLAN MODE
|
|
543
|
-
|
|
544
|
-
In each user message, the environment_details will specify the current mode. There are two modes:
|
|
545
|
-
|
|
546
|
-
- ACT MODE: In this mode, you have access to all tools EXCEPT the plan_mode_respond tool.
|
|
547
|
-
- In ACT MODE, you use tools to accomplish the user's task. Once you've completed the user's task, you use the attempt_completion tool to present the result of the task to the user.
|
|
548
|
-
- PLAN MODE: In this special mode, you have access to the plan_mode_respond tool.
|
|
549
|
-
- In PLAN MODE, the goal is to gather information and get context to create a detailed plan for accomplishing the task, which the user will review and approve before they switch you to ACT MODE to implement the solution.
|
|
550
|
-
- In PLAN MODE, when you need to converse with the user or present a plan, you should use the plan_mode_respond tool to deliver your response directly, rather than using <thinking> tags to analyze when to respond. Do not talk about using plan_mode_respond - just use it directly to share your thoughts and provide helpful answers.
|
|
551
|
-
|
|
552
|
-
## What is PLAN MODE?
|
|
553
|
-
|
|
554
|
-
- While you are usually in ACT MODE, the user may switch to PLAN MODE in order to have a back and forth with you to plan how to best accomplish the task.
|
|
555
|
-
- When starting in PLAN MODE, depending on the user's request, you may need to do some information gathering e.g. using read_file or search_files to get more context about the task. You may also ask the user clarifying questions to get a better understanding of the task. You may return mermaid diagrams to visually display your understanding.
|
|
556
|
-
- Once you've gained more context about the user's request, you should architect a detailed plan for how you will accomplish the task. Returning mermaid diagrams may be helpful here as well.
|
|
557
|
-
- Then you might ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it.
|
|
558
|
-
- If at any point a mermaid diagram would make your plan clearer to help the user quickly see the structure, you are encouraged to include a Mermaid code block in the response. (Note: if you use colors in your mermaid diagrams, be sure to use high contrast colors so the text is readable.)
|
|
559
|
-
- Finally once it seems like you've reached a good plan, ask the user to switch you back to ACT MODE to implement the solution.
|
|
560
|
-
|
|
556
|
+
|
|
561
557
|
{% if enable_active_context_in_generate %}
|
|
562
558
|
====
|
|
563
559
|
|
|
@@ -623,16 +619,20 @@ class BaseAgent(ABC):
|
|
|
623
619
|
{% if extra_docs %}
|
|
624
620
|
====
|
|
625
621
|
|
|
626
|
-
RULES PROVIDED BY USER
|
|
622
|
+
RULES OR DOCUMENTS PROVIDED BY USER
|
|
627
623
|
|
|
628
624
|
The following rules are provided by the user, and you must follow them strictly.
|
|
629
625
|
|
|
626
|
+
<user_rule_or_document_files>
|
|
630
627
|
{% for key, value in extra_docs.items() %}
|
|
631
|
-
<
|
|
628
|
+
<user_rule_or_document_file>
|
|
632
629
|
##File: {{ key }}
|
|
633
630
|
{{ value }}
|
|
634
|
-
</
|
|
635
|
-
{% endfor %}
|
|
631
|
+
</user_rule_or_document_file>
|
|
632
|
+
{% endfor %}
|
|
633
|
+
</user_rule_or_document_files>
|
|
634
|
+
|
|
635
|
+
Make sure you always start your task by using the read_file tool to get the relevant RULE files listed in index.md based on the user's specific requirements.
|
|
636
636
|
{% endif %}
|
|
637
637
|
|
|
638
638
|
====
|
|
@@ -675,7 +675,7 @@ class BaseAgent(ABC):
|
|
|
675
675
|
tool_case_docs = ToolRegistry.get_all_tools_case_docs()
|
|
676
676
|
tool_guidelines = ToolRegistry.get_all_tool_use_guidelines()
|
|
677
677
|
|
|
678
|
-
extra_docs =
|
|
678
|
+
extra_docs = get_required_and_index_rules()
|
|
679
679
|
|
|
680
680
|
env_info = detect_env()
|
|
681
681
|
shell_type = "bash"
|
|
@@ -763,6 +763,10 @@ class BaseAgent(ABC):
|
|
|
763
763
|
|
|
764
764
|
iteration_count = 0
|
|
765
765
|
tool_executed = False
|
|
766
|
+
|
|
767
|
+
should_yield_completion_event = False
|
|
768
|
+
completion_event = None
|
|
769
|
+
|
|
766
770
|
while True:
|
|
767
771
|
iteration_count += 1
|
|
768
772
|
logger.info(f"Starting LLM interaction cycle #{iteration_count}")
|
|
@@ -770,10 +774,14 @@ class BaseAgent(ABC):
|
|
|
770
774
|
last_message = conversations[-1]
|
|
771
775
|
if last_message["role"] == "assistant":
|
|
772
776
|
logger.info(f"Last message is assistant, skipping LLM interaction cycle")
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
+
if should_yield_completion_event:
|
|
778
|
+
if completion_event is None:
|
|
779
|
+
yield CompletionEvent(completion=AttemptCompletionTool(
|
|
780
|
+
result=last_message["content"],
|
|
781
|
+
command=""
|
|
782
|
+
), completion_xml="")
|
|
783
|
+
else:
|
|
784
|
+
yield completion_event
|
|
777
785
|
break
|
|
778
786
|
logger.info(
|
|
779
787
|
f"Starting LLM interaction cycle. History size: {len(conversations)}")
|
|
@@ -834,11 +842,13 @@ class BaseAgent(ABC):
|
|
|
834
842
|
logger.info(
|
|
835
843
|
"AttemptCompletionTool received. Finalizing session.")
|
|
836
844
|
logger.info(f"Completion result: {tool_obj.result[:50]}...")
|
|
837
|
-
|
|
845
|
+
completion_event = CompletionEvent(completion=tool_obj, completion_xml=tool_xml)
|
|
838
846
|
logger.info(
|
|
839
847
|
"AgenticEdit analyze loop finished due to AttemptCompletion.")
|
|
840
848
|
save_formatted_log(self.args.source_dir, json.dumps(conversations, ensure_ascii=False), "agentic_conversation")
|
|
841
|
-
|
|
849
|
+
mark_event_should_finish = True
|
|
850
|
+
should_yield_completion_event = True
|
|
851
|
+
continue
|
|
842
852
|
|
|
843
853
|
if isinstance(tool_obj, PlanModeRespondTool):
|
|
844
854
|
logger.info(
|
|
@@ -848,7 +858,7 @@ class BaseAgent(ABC):
|
|
|
848
858
|
logger.info(
|
|
849
859
|
"AgenticEdit analyze loop finished due to PlanModeRespond.")
|
|
850
860
|
save_formatted_log(self.args.source_dir, json.dumps(conversations, ensure_ascii=False), "agentic_conversation")
|
|
851
|
-
|
|
861
|
+
continue
|
|
852
862
|
|
|
853
863
|
# Resolve the tool
|
|
854
864
|
resolver_cls = ToolRegistry.get_resolver_for_tool(tool_obj)
|
|
@@ -1184,7 +1194,7 @@ class BaseAgent(ABC):
|
|
|
1184
1194
|
base_url = "/agent/base"
|
|
1185
1195
|
|
|
1186
1196
|
try:
|
|
1187
|
-
event_stream = self.
|
|
1197
|
+
event_stream = self.agentic_run(request)
|
|
1188
1198
|
for agent_event in event_stream:
|
|
1189
1199
|
content = None
|
|
1190
1200
|
metadata = EventMetadata(
|
|
@@ -1308,6 +1318,148 @@ class BaseAgent(ABC):
|
|
|
1308
1318
|
event_manager.write_error(
|
|
1309
1319
|
content=error_content.to_dict(), metadata=metadata.to_dict())
|
|
1310
1320
|
raise e
|
|
1321
|
+
|
|
1322
|
+
def run_with_generator(self, request: AgentRequest):
|
|
1323
|
+
start_time = time.time()
|
|
1324
|
+
project_name = os.path.basename(os.path.abspath(self.args.source_dir))
|
|
1325
|
+
yield ("thinking",agentic_lang.get_message_with_format("agent_start", project_name=project_name))
|
|
1326
|
+
|
|
1327
|
+
# 添加token累计变量
|
|
1328
|
+
total_input_tokens = 0
|
|
1329
|
+
total_output_tokens = 0
|
|
1330
|
+
total_input_cost = 0.0
|
|
1331
|
+
total_output_cost = 0.0
|
|
1332
|
+
model_name = ""
|
|
1333
|
+
|
|
1334
|
+
try:
|
|
1335
|
+
event_stream = self.agentic_run(request)
|
|
1336
|
+
for event in event_stream:
|
|
1337
|
+
if isinstance(event, TokenUsageEvent):
|
|
1338
|
+
# 获取模型信息以计算价格
|
|
1339
|
+
from autocoder.utils import llms as llm_utils
|
|
1340
|
+
model_name = ",".join(llm_utils.get_llm_names(self.llm))
|
|
1341
|
+
model_info = llm_utils.get_model_info(
|
|
1342
|
+
model_name, self.args.product_mode) or {}
|
|
1343
|
+
input_price = model_info.get(
|
|
1344
|
+
"input_price", 0.0) if model_info else 0.0
|
|
1345
|
+
output_price = model_info.get(
|
|
1346
|
+
"output_price", 0.0) if model_info else 0.0
|
|
1347
|
+
|
|
1348
|
+
# 计算成本
|
|
1349
|
+
last_meta = event.usage
|
|
1350
|
+
input_cost = (last_meta.input_tokens_count *
|
|
1351
|
+
input_price) / 1000000 # 转换为百万
|
|
1352
|
+
output_cost = (
|
|
1353
|
+
last_meta.generated_tokens_count * output_price) / 1000000
|
|
1354
|
+
|
|
1355
|
+
# 累计token使用情况
|
|
1356
|
+
total_input_tokens += last_meta.input_tokens_count
|
|
1357
|
+
total_output_tokens += last_meta.generated_tokens_count
|
|
1358
|
+
total_input_cost += input_cost
|
|
1359
|
+
total_output_cost += output_cost
|
|
1360
|
+
|
|
1361
|
+
# 记录日志
|
|
1362
|
+
logger.info(agentic_lang.get_message_with_format(
|
|
1363
|
+
"token_usage_log",
|
|
1364
|
+
model=model_name,
|
|
1365
|
+
input_tokens=last_meta.input_tokens_count,
|
|
1366
|
+
output_tokens=last_meta.generated_tokens_count,
|
|
1367
|
+
input_cost=input_cost,
|
|
1368
|
+
output_cost=output_cost))
|
|
1369
|
+
|
|
1370
|
+
elif isinstance(event, LLMThinkingEvent):
|
|
1371
|
+
# 以较不显眼的样式呈现思考内容
|
|
1372
|
+
yield ("thinking",f"{event.text}")
|
|
1373
|
+
elif isinstance(event, LLMOutputEvent):
|
|
1374
|
+
# 打印常规LLM输出
|
|
1375
|
+
yield ("thinking",event.text)
|
|
1376
|
+
elif isinstance(event, ToolCallEvent):
|
|
1377
|
+
# 跳过显示完成工具的调用
|
|
1378
|
+
if hasattr(event.tool, "result") and hasattr(event.tool, "command"):
|
|
1379
|
+
continue # 不显示完成工具的调用
|
|
1380
|
+
|
|
1381
|
+
tool_name = type(event.tool).__name__
|
|
1382
|
+
# 使用工具展示函数(需要自行实现)
|
|
1383
|
+
display_content = get_tool_display_message(event.tool)
|
|
1384
|
+
yield ("thinking", agentic_lang.get_message_with_format("tool_operation_title", tool_name=tool_name))
|
|
1385
|
+
yield ("thinking",display_content)
|
|
1386
|
+
|
|
1387
|
+
elif isinstance(event, ToolResultEvent):
|
|
1388
|
+
# 跳过显示完成工具的结果
|
|
1389
|
+
if event.tool_name == "AttemptCompletionTool":
|
|
1390
|
+
continue
|
|
1391
|
+
|
|
1392
|
+
result = event.result
|
|
1393
|
+
success_status = agentic_lang.get_message("success_status") if result.success else agentic_lang.get_message("failure_status")
|
|
1394
|
+
base_content = agentic_lang.get_message_with_format("status", status=success_status) + "\n"
|
|
1395
|
+
base_content += agentic_lang.get_message_with_format("message", message=result.message) + "\n"
|
|
1396
|
+
|
|
1397
|
+
# 格式化内容函数
|
|
1398
|
+
def _format_content(content):
|
|
1399
|
+
if len(content) > 200:
|
|
1400
|
+
return f"{content[:100]}\n...\n{content[-100:]}"
|
|
1401
|
+
else:
|
|
1402
|
+
return content
|
|
1403
|
+
|
|
1404
|
+
# 首先准备基本信息面板
|
|
1405
|
+
panel_content = [base_content]
|
|
1406
|
+
syntax_content = None
|
|
1407
|
+
|
|
1408
|
+
if result.content is not None:
|
|
1409
|
+
content_str = ""
|
|
1410
|
+
try:
|
|
1411
|
+
if isinstance(result.content, (dict, list)):
|
|
1412
|
+
import json
|
|
1413
|
+
content_str = json.dumps(
|
|
1414
|
+
result.content, indent=2, ensure_ascii=False)
|
|
1415
|
+
syntax_content = _format_content(content_str)
|
|
1416
|
+
elif isinstance(result.content, str) and ('\n' in result.content or result.content.strip().startswith('<')):
|
|
1417
|
+
syntax_content = _format_content(result.content)
|
|
1418
|
+
else:
|
|
1419
|
+
content_str = str(result.content)
|
|
1420
|
+
# 直接附加简单字符串内容
|
|
1421
|
+
panel_content.append(
|
|
1422
|
+
_format_content(content_str))
|
|
1423
|
+
except Exception as e:
|
|
1424
|
+
logger.warning(agentic_lang.get_message_with_format("format_tool_error", error=str(e)))
|
|
1425
|
+
panel_content.append(
|
|
1426
|
+
# 备用
|
|
1427
|
+
_format_content(str(result.content)))
|
|
1428
|
+
|
|
1429
|
+
# 打印基本信息面板
|
|
1430
|
+
yield ("thinking",_format_content("\n".join(panel_content)))
|
|
1431
|
+
# 单独打印语法高亮内容(如果存在)
|
|
1432
|
+
if syntax_content:
|
|
1433
|
+
yield ("thinking",syntax_content)
|
|
1434
|
+
|
|
1435
|
+
elif isinstance(event, CompletionEvent):
|
|
1436
|
+
yield ("result",event.completion.result)
|
|
1437
|
+
if event.completion.command:
|
|
1438
|
+
yield ("result", agentic_lang.get_message_with_format("suggested_command", command=event.completion.command))
|
|
1439
|
+
elif isinstance(event, ErrorEvent):
|
|
1440
|
+
yield ("result", agentic_lang.get_message("error_title"))
|
|
1441
|
+
yield ("result", agentic_lang.get_message_with_format("error_content", message=event.message))
|
|
1442
|
+
|
|
1443
|
+
time.sleep(0.1) # 小延迟以获得更好的视觉流
|
|
1444
|
+
|
|
1445
|
+
except Exception as e:
|
|
1446
|
+
logger.exception(agentic_lang.get_message("unexpected_error"))
|
|
1447
|
+
yield ("result",agentic_lang.get_message("fatal_error_title"))
|
|
1448
|
+
yield ("result",agentic_lang.get_message_with_format("fatal_error_content", error=str(e)))
|
|
1449
|
+
raise e
|
|
1450
|
+
finally:
|
|
1451
|
+
# 在结束时打印累计的token使用情况
|
|
1452
|
+
duration = time.time() - start_time
|
|
1453
|
+
yield ("result","\n" + self.printer.get_message_from_key_with_format("code_generation_complete",
|
|
1454
|
+
duration=duration,
|
|
1455
|
+
input_tokens=total_input_tokens,
|
|
1456
|
+
output_tokens=total_output_tokens,
|
|
1457
|
+
input_cost=total_input_cost,
|
|
1458
|
+
output_cost=total_output_cost,
|
|
1459
|
+
speed=0.0,
|
|
1460
|
+
model_names=model_name,
|
|
1461
|
+
sampling_count=1))
|
|
1462
|
+
yield ("result", "\n" + agentic_lang.get_message("agent_execution_complete"))
|
|
1311
1463
|
|
|
1312
1464
|
def run_in_terminal(self, request: AgentRequest):
|
|
1313
1465
|
"""
|
|
@@ -1402,10 +1554,7 @@ class BaseAgent(ABC):
|
|
|
1402
1554
|
|
|
1403
1555
|
# 格式化内容函数
|
|
1404
1556
|
def _format_content(content):
|
|
1405
|
-
|
|
1406
|
-
return f"{content[:100]}\n...\n{content[-100:]}"
|
|
1407
|
-
else:
|
|
1408
|
-
return content
|
|
1557
|
+
return content[:200]
|
|
1409
1558
|
|
|
1410
1559
|
# 首先准备基本信息面板
|
|
1411
1560
|
panel_content = [base_content]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Default tools initialization module
|
|
3
3
|
Used to initialize and register default tools
|
|
4
4
|
"""
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Optional, List, Any
|
|
6
6
|
from loguru import logger
|
|
7
7
|
import byzerllm
|
|
8
8
|
from .tool_registry import ToolRegistry
|
|
@@ -502,10 +502,30 @@ def register_default_tools_case_doc(params: Dict[str, Any]):
|
|
|
502
502
|
|
|
503
503
|
logger.info(f"处理了 {len(DEFAULT_TOOLS_CASE_DOC)} 个默认工具用例文档")
|
|
504
504
|
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
def get_default_tool_names():
|
|
506
|
+
return [
|
|
507
|
+
"execute_command",
|
|
508
|
+
"read_file",
|
|
509
|
+
"write_to_file",
|
|
510
|
+
"replace_in_file",
|
|
511
|
+
"search_files",
|
|
512
|
+
"list_files",
|
|
513
|
+
"ask_followup_question",
|
|
514
|
+
"attempt_completion",
|
|
515
|
+
"plan_mode_respond",
|
|
516
|
+
"use_mcp_tool",
|
|
517
|
+
"talk_to",
|
|
518
|
+
"talk_to_group"
|
|
519
|
+
]
|
|
520
|
+
|
|
521
|
+
def register_default_tools(params: Dict[str, Any], default_tools_list: Optional[List[str]] = None):
|
|
507
522
|
"""
|
|
508
|
-
Register
|
|
523
|
+
Register default tools
|
|
524
|
+
|
|
525
|
+
Args:
|
|
526
|
+
params: Parameters for tool generators
|
|
527
|
+
default_tools_list: Optional list of tool names to register. If provided, only tools in this list will be registered.
|
|
528
|
+
If None, all default tools will be registered.
|
|
509
529
|
"""
|
|
510
530
|
tool_desc_gen = ToolDescGenerators(params)
|
|
511
531
|
tool_examples_gen = ToolExampleGenerators(params)
|
|
@@ -661,12 +681,24 @@ def register_default_tools(params: Dict[str, Any]):
|
|
|
661
681
|
"case_docs": []
|
|
662
682
|
}
|
|
663
683
|
}
|
|
664
|
-
#
|
|
684
|
+
# 先使用统一的工具注册方法注册工具
|
|
685
|
+
registered_count = 0
|
|
665
686
|
for tool_tag, tool_info in DEFAULT_TOOLS.items():
|
|
687
|
+
# attempt_completion 工具是必须注册的
|
|
688
|
+
if tool_tag == "attempt_completion":
|
|
689
|
+
ToolRegistry.register_unified_tool(tool_tag, tool_info)
|
|
690
|
+
registered_count += 1
|
|
691
|
+
continue
|
|
692
|
+
|
|
693
|
+
# 如果提供了工具列表,则只注册列表中的工具
|
|
694
|
+
if default_tools_list is not None and tool_tag not in default_tools_list:
|
|
695
|
+
continue
|
|
696
|
+
|
|
666
697
|
ToolRegistry.register_unified_tool(tool_tag, tool_info)
|
|
698
|
+
registered_count += 1
|
|
667
699
|
|
|
668
700
|
logger.info(
|
|
669
|
-
f"Registered {
|
|
701
|
+
f"Registered {registered_count} default tools using unified registration")
|
|
670
702
|
|
|
671
703
|
# 然后注册默认工具用例文档
|
|
672
704
|
# 这样可以确保在注册用例文档时,所有工具已经注册完成
|