auto-coder 0.1.361__py3-none-any.whl → 0.1.363__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.361.dist-info → auto_coder-0.1.363.dist-info}/METADATA +2 -1
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/RECORD +57 -29
- autocoder/agent/auto_learn.py +249 -262
- autocoder/agent/base_agentic/__init__.py +0 -0
- autocoder/agent/base_agentic/agent_hub.py +169 -0
- autocoder/agent/base_agentic/agentic_lang.py +112 -0
- autocoder/agent/base_agentic/agentic_tool_display.py +180 -0
- autocoder/agent/base_agentic/base_agent.py +1582 -0
- autocoder/agent/base_agentic/default_tools.py +683 -0
- autocoder/agent/base_agentic/test_base_agent.py +82 -0
- autocoder/agent/base_agentic/tool_registry.py +425 -0
- autocoder/agent/base_agentic/tools/__init__.py +12 -0
- autocoder/agent/base_agentic/tools/ask_followup_question_tool_resolver.py +72 -0
- autocoder/agent/base_agentic/tools/attempt_completion_tool_resolver.py +37 -0
- autocoder/agent/base_agentic/tools/base_tool_resolver.py +35 -0
- autocoder/agent/base_agentic/tools/example_tool_resolver.py +46 -0
- autocoder/agent/base_agentic/tools/execute_command_tool_resolver.py +72 -0
- autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +110 -0
- autocoder/agent/base_agentic/tools/plan_mode_respond_tool_resolver.py +35 -0
- autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +54 -0
- autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +156 -0
- autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +134 -0
- autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py +96 -0
- autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py +79 -0
- autocoder/agent/base_agentic/tools/use_mcp_tool_resolver.py +44 -0
- autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +58 -0
- autocoder/agent/base_agentic/types.py +189 -0
- autocoder/agent/base_agentic/utils.py +100 -0
- autocoder/auto_coder.py +1 -1
- autocoder/auto_coder_runner.py +36 -14
- autocoder/chat/conf_command.py +11 -10
- autocoder/commands/auto_command.py +227 -159
- autocoder/common/__init__.py +2 -2
- autocoder/common/ignorefiles/ignore_file_utils.py +12 -8
- autocoder/common/result_manager.py +10 -2
- autocoder/common/rulefiles/autocoderrules_utils.py +169 -0
- autocoder/common/save_formatted_log.py +1 -1
- autocoder/common/v2/agent/agentic_edit.py +53 -41
- autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py +15 -12
- autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +73 -1
- autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py +132 -4
- autocoder/common/v2/agent/agentic_edit_types.py +1 -2
- autocoder/common/v2/agent/agentic_tool_display.py +2 -3
- autocoder/common/v2/code_auto_generate_editblock.py +3 -1
- autocoder/index/index.py +14 -8
- autocoder/privacy/model_filter.py +297 -35
- autocoder/rag/long_context_rag.py +424 -397
- autocoder/rag/test_doc_filter.py +393 -0
- autocoder/rag/test_long_context_rag.py +473 -0
- autocoder/rag/test_token_limiter.py +342 -0
- autocoder/shadows/shadow_manager.py +1 -3
- autocoder/utils/_markitdown.py +22 -3
- autocoder/version.py +1 -1
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/top_level.txt +0 -0
autocoder/chat/conf_command.py
CHANGED
|
@@ -183,14 +183,15 @@ def _handle_help(memory: Dict[str, Any], args: List[str]) -> str:
|
|
|
183
183
|
|
|
184
184
|
# Command dispatch table
|
|
185
185
|
COMMAND_HANDLERS: Dict[str, Callable[[Dict[str, Any], List[str]], str]] = {
|
|
186
|
-
"list": _handle_list_conf,
|
|
187
|
-
"show": _handle_list_conf, # Alias
|
|
188
|
-
"get": _handle_get_conf,
|
|
189
|
-
"set": _handle_set_conf,
|
|
190
|
-
"delete": _handle_delete_conf,
|
|
191
|
-
"del": _handle_delete_conf, # Alias
|
|
192
|
-
"rm": _handle_delete_conf, # Alias
|
|
193
|
-
"
|
|
186
|
+
"/list": _handle_list_conf,
|
|
187
|
+
"/show": _handle_list_conf, # Alias
|
|
188
|
+
"/get": _handle_get_conf,
|
|
189
|
+
"/set": _handle_set_conf,
|
|
190
|
+
"/delete": _handle_delete_conf,
|
|
191
|
+
"/del": _handle_delete_conf, # Alias
|
|
192
|
+
"/rm": _handle_delete_conf, # Alias
|
|
193
|
+
"/drop": _handle_delete_conf, # Add this line for /drop command
|
|
194
|
+
"/help": _handle_help,
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
def handle_conf_command(command_args: str, memory: Dict[str, Any]) -> str:
|
|
@@ -205,7 +206,7 @@ def handle_conf_command(command_args: str, memory: Dict[str, Any]) -> str:
|
|
|
205
206
|
Returns:
|
|
206
207
|
A string response to be displayed to the user.
|
|
207
208
|
"""
|
|
208
|
-
conf_str = command_args.strip()
|
|
209
|
+
conf_str = command_args.strip()
|
|
209
210
|
|
|
210
211
|
# Handle special subcommands first
|
|
211
212
|
if conf_str.startswith("/export"):
|
|
@@ -239,7 +240,7 @@ def handle_conf_command(command_args: str, memory: Dict[str, Any]) -> str:
|
|
|
239
240
|
return _handle_list_conf(memory, [])
|
|
240
241
|
else:
|
|
241
242
|
command = args[0].lower()
|
|
242
|
-
command_args_list = args[1:]
|
|
243
|
+
command_args_list = args[1:]
|
|
243
244
|
|
|
244
245
|
# Check if the first argument is a known command or potentially a pattern
|
|
245
246
|
handler = COMMAND_HANDLERS.get(command)
|
|
@@ -628,72 +628,67 @@ class CommandAutoTuner:
|
|
|
628
628
|
@byzerllm.prompt()
|
|
629
629
|
def _command_readme(self) -> str:
|
|
630
630
|
'''
|
|
631
|
-
|
|
631
|
+
函数列表:
|
|
632
632
|
|
|
633
|
-
<
|
|
634
|
-
|
|
635
|
-
<command>
|
|
633
|
+
<functions>
|
|
634
|
+
<function>
|
|
636
635
|
<name>add_files</name>
|
|
637
636
|
<description>
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
637
|
+
添加文件到活跃区,在使用 chat 或 coding 函数时,活跃区的文件会被自动包含在上下文中。
|
|
638
|
+
支持多种添加方式:具体文件路径、模式匹配(glob 语法如 *.py)、相对路径或绝对路径。
|
|
639
|
+
|
|
640
|
+
使用场景:
|
|
641
|
+
1. 在执行 coding 前准备上下文
|
|
642
|
+
2. 当 coding 执行结果缺少必要文件修改时进行补充,然后重新执行 coding 函数,或者在coding函数中的query显示 @需要的文件或者符号。
|
|
643
|
+
3. 用户可能会主动要求你帮他添加一些文件或者管理文件分组
|
|
641
644
|
</description>
|
|
642
645
|
<usage>
|
|
643
|
-
该方法只有一个参数 args
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
使用例子:
|
|
646
|
+
该方法只有一个参数 args,为字符串列表类型。
|
|
647
|
+
|
|
648
|
+
# 基本用法 - 直接添加文件
|
|
648
649
|
|
|
650
|
+
## 添加单个文件(推荐使用绝对路径)
|
|
649
651
|
add_files(args=["/absolute/path/to/file1.py"])
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
##
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
/group /add my_group
|
|
669
|
-
|
|
670
|
-
###
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
/group /
|
|
675
|
-
|
|
676
|
-
###
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
/group /
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
/group /list
|
|
687
|
-
|
|
688
|
-
### /reset
|
|
689
|
-
重置当前活跃组,但保留文件列表
|
|
690
|
-
使用例子:
|
|
691
|
-
/group /reset
|
|
692
|
-
|
|
652
|
+
|
|
653
|
+
## 添加多个文件
|
|
654
|
+
add_files(args=["/path/to/file1.py", "/path/to/file2.py"])
|
|
655
|
+
|
|
656
|
+
## 使用模式匹配(支持 glob 语法)
|
|
657
|
+
add_files(args=["**/*.py"]) # 添加所有 .py 文件
|
|
658
|
+
add_files(args=["src/**/*.ts"]) # 添加 src 目录下所有 .ts 文件
|
|
659
|
+
|
|
660
|
+
# 注意:添加文件时应尽量精确,避免添加过多无关文件
|
|
661
|
+
|
|
662
|
+
# 子命令功能
|
|
663
|
+
|
|
664
|
+
## 刷新文件列表
|
|
665
|
+
add_files(args=["/refresh"])
|
|
666
|
+
|
|
667
|
+
## 文件分组管理
|
|
668
|
+
|
|
669
|
+
### 创建新组并保存当前文件列表
|
|
670
|
+
add_files(args=["/group", "/add", "my_group"])
|
|
671
|
+
|
|
672
|
+
### 删除指定组
|
|
673
|
+
add_files(args=["/group", "/drop", "my_group"])
|
|
674
|
+
|
|
675
|
+
### 设置组描述信息
|
|
676
|
+
add_files(args=["/group", "/set", "my_group", "这个组用于前端组件开发"])
|
|
677
|
+
|
|
678
|
+
### 列出所有已定义的组
|
|
679
|
+
add_files(args=["/group", "/list"])
|
|
680
|
+
|
|
681
|
+
### 重置当前活跃组(保留文件列表)
|
|
682
|
+
add_files(args=["/group", "/reset"])
|
|
683
|
+
|
|
684
|
+
# 实用技巧:
|
|
685
|
+
# - 可以先使用 find_files_by_name 或 find_files_by_content 查找相关文件
|
|
686
|
+
# - 然后将结果添加到活跃区
|
|
687
|
+
# - 对于大型项目,可以创建不同的文件组用于不同功能的开发
|
|
693
688
|
</usage>
|
|
694
|
-
</
|
|
689
|
+
</function>
|
|
695
690
|
|
|
696
|
-
<
|
|
691
|
+
<function>
|
|
697
692
|
<name>remove_files</name>
|
|
698
693
|
<description>从活跃区移除文件。可以指定多个文件,支持文件名或完整路径。</description>
|
|
699
694
|
<usage>
|
|
@@ -713,20 +708,47 @@ class CommandAutoTuner:
|
|
|
713
708
|
remove_files(file_names=["/path/to/file1.py,file2.py"])
|
|
714
709
|
|
|
715
710
|
</usage>
|
|
716
|
-
</
|
|
711
|
+
</function>
|
|
717
712
|
|
|
718
|
-
<
|
|
713
|
+
<function>
|
|
719
714
|
<name>list_files</name>
|
|
720
|
-
<description>
|
|
715
|
+
<description>
|
|
716
|
+
列出指定目录下的所有文件,帮助快速了解项目结构和文件组织。
|
|
717
|
+
|
|
718
|
+
使用场景:
|
|
719
|
+
1. 探索项目结构,了解特定目录包含哪些文件
|
|
720
|
+
2. 在使用 read_files 或 add_files 前先确认目标文件
|
|
721
|
+
3. 当 get_project_structure 返回内容过多时作为替代选择
|
|
722
|
+
4. 寻找特定类型的文件(如配置文件、测试文件)
|
|
723
|
+
</description>
|
|
721
724
|
<usage>
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
725
|
+
该函数接受一个参数 path,表示要列出文件的目录路径。
|
|
726
|
+
|
|
727
|
+
# 基本用法
|
|
728
|
+
|
|
729
|
+
## 列出当前目录文件
|
|
730
|
+
list_files(path=".")
|
|
731
|
+
|
|
732
|
+
## 列出指定目录文件
|
|
733
|
+
list_files(path="/absolute/path/to/directory")
|
|
734
|
+
list_files(path="src/components")
|
|
735
|
+
|
|
736
|
+
## 列出系统目录文件
|
|
737
|
+
list_files(path="/tmp")
|
|
738
|
+
|
|
739
|
+
# 注意事项:
|
|
740
|
+
# - 只列出指定目录下的直接文件,不包括子目录中的文件
|
|
741
|
+
# - 返回结果包含文件名,以换行符分隔
|
|
742
|
+
# - 可与其他函数配合使用,如获取目录后通过 read_files 读取感兴趣的文件
|
|
743
|
+
|
|
744
|
+
# 实用技巧:
|
|
745
|
+
# - 结合 find_files_by_name 深入查找特定文件
|
|
746
|
+
# - 遍历项目结构时可以先列出顶层目录,再逐层深入
|
|
747
|
+
# - 查看构建输出或日志目录时特别有用
|
|
726
748
|
</usage>
|
|
727
|
-
</
|
|
749
|
+
</function>
|
|
728
750
|
|
|
729
|
-
<
|
|
751
|
+
<function>
|
|
730
752
|
<name>revert</name>
|
|
731
753
|
<description>
|
|
732
754
|
撤销最后一次代码修改,恢复到修改前的状态。同时会删除对应的操作记录文件,
|
|
@@ -743,9 +765,9 @@ class CommandAutoTuner:
|
|
|
743
765
|
- 撤销后会同时删除对应的操作记录文件
|
|
744
766
|
- 如果没有可撤销的操作会提示错误
|
|
745
767
|
</usage>
|
|
746
|
-
</
|
|
768
|
+
</function>
|
|
747
769
|
|
|
748
|
-
<
|
|
770
|
+
<function>
|
|
749
771
|
<name>help</name>
|
|
750
772
|
<description>
|
|
751
773
|
显示帮助信息,也可以执行一些配置需求。
|
|
@@ -784,58 +806,108 @@ class CommandAutoTuner:
|
|
|
784
806
|
** 特别注意,这些配置参数会影响 coding,chat 的执行效果或者结果 根据返回调用该函数做合理的配置**
|
|
785
807
|
|
|
786
808
|
</usage>
|
|
787
|
-
</
|
|
809
|
+
</function>
|
|
788
810
|
|
|
789
|
-
<
|
|
811
|
+
<function>
|
|
790
812
|
<name>chat</name>
|
|
791
|
-
<description>进入聊天模式,与AI
|
|
813
|
+
<description>进入聊天模式,与AI进行交互对话。支持多轮对话、上下文理解和代码分析能力,是与系统进行自然交流的主要方式。</description>
|
|
792
814
|
<usage>
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
## 基础对话
|
|
796
|
-
直接输入对话内容
|
|
797
|
-
使用例子:
|
|
815
|
+
该命令支持丰富的交互方式和特殊功能,是你与AI交流的主要入口。
|
|
798
816
|
|
|
817
|
+
## 基础用法
|
|
818
|
+
|
|
819
|
+
### 基础对话
|
|
820
|
+
直接输入对话内容,系统会结合上下文进行回答
|
|
821
|
+
```
|
|
799
822
|
chat(query="这个项目使用了什么技术栈?")
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
823
|
+
chat(query="如何优化当前代码的性能?")
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
### 会话管理
|
|
827
|
+
使用 /new 开启全新对话,清除历史上下文
|
|
828
|
+
```
|
|
829
|
+
chat(query="/new 让我们讨论新的话题")
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
## 代码分析功能
|
|
833
|
+
|
|
834
|
+
### 代码审查
|
|
835
|
+
使用 /review 请求对特定文件的代码审查
|
|
836
|
+
```
|
|
811
837
|
chat(query="/review @main.py")
|
|
838
|
+
chat(query="/review @src/components/Button.tsx 分析这个组件有什么可以改进的地方")
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
### 提交审查
|
|
842
|
+
对最后一次代码提交进行审查
|
|
843
|
+
```
|
|
844
|
+
chat(query="/review /commit")
|
|
845
|
+
```
|
|
812
846
|
|
|
813
847
|
## 特殊功能
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
-
|
|
817
|
-
|
|
818
|
-
|
|
848
|
+
|
|
849
|
+
### 上下文控制
|
|
850
|
+
- `/no_context`:不使用当前文件上下文,适合纯粹的概念讨论
|
|
851
|
+
```
|
|
852
|
+
chat(query="/no_context 解释一下什么是依赖注入")
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
### 高级检索
|
|
856
|
+
- `/mcp`:获取 MCP 服务内容
|
|
857
|
+
- `/rag`:使用检索增强生成,可结合外部知识库
|
|
858
|
+
```
|
|
859
|
+
chat(query="/rag 查询如何开发插件")
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
### 结果管理
|
|
863
|
+
- `/copy`:自动将结果复制到剪贴板
|
|
864
|
+
- `/save`:将结果保存到全局记忆,自动加入后续上下文
|
|
865
|
+
```
|
|
866
|
+
chat(query="/copy 生成一个处理用户登录的函数")
|
|
867
|
+
chat(query="/save 总结这个项目的架构")
|
|
868
|
+
```
|
|
819
869
|
|
|
820
870
|
## 引用语法
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
使用例子:
|
|
826
|
-
|
|
871
|
+
|
|
872
|
+
### 文件引用
|
|
873
|
+
使用 @ 引用特定文件,使回答更加针对性
|
|
874
|
+
```
|
|
827
875
|
chat(query="@utils.py 这个文件的主要功能是什么?")
|
|
876
|
+
chat(query="@src/models/User.js 这个模型有什么需要改进的地方?")
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
### 符号引用
|
|
880
|
+
使用 @@ 引用特定函数或类,分析特定代码块
|
|
881
|
+
```
|
|
828
882
|
chat(query="@@process_data 这个函数的实现有什么问题?")
|
|
829
|
-
chat(query="
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
883
|
+
chat(query="@@UserController 这个类的设计是否合理?")
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
### 图片引用
|
|
887
|
+
使用特殊标记引入图片,分析视觉内容
|
|
888
|
+
```
|
|
889
|
+
chat(query="<_image_>screenshots/error.png</_image_> 这个错误如何解决?")
|
|
890
|
+
chat(query="<_image_>design/flowchart.png</_image_> 根据这个流程图实现代码")
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
## 使用场景推荐
|
|
894
|
+
|
|
895
|
+
- 项目探索:使用 chat 快速了解项目结构和关键组件
|
|
896
|
+
- 代码分析:结合 @ 引用分析特定文件或组件
|
|
897
|
+
- 问题诊断:遇到错误时,可以将错误信息发送给AI分析
|
|
898
|
+
- 设计讨论:在编码前先讨论设计方案和架构选择
|
|
899
|
+
- 学习辅助:询问特定技术或框架的使用方法
|
|
900
|
+
|
|
901
|
+
## 注意事项
|
|
902
|
+
|
|
903
|
+
- 参考特定代码时尽量使用 @ 引用,可获得更精准的回答
|
|
904
|
+
- 复杂问题可以分步提问,逐步深入
|
|
905
|
+
- 使用 /save 保存重要信息,避免上下文丢失
|
|
906
|
+
- 大型项目中建议指定文件范围,避免上下文过大
|
|
835
907
|
</usage>
|
|
836
|
-
</
|
|
908
|
+
</function>
|
|
837
909
|
|
|
838
|
-
<
|
|
910
|
+
<function>
|
|
839
911
|
<name>coding</name>
|
|
840
912
|
<description>代码生成函数,用于生成、修改和重构代码。</description>
|
|
841
913
|
<usage>
|
|
@@ -856,11 +928,7 @@ class CommandAutoTuner:
|
|
|
856
928
|
|
|
857
929
|
coding(query="/apply 根据我们的历史对话实现代码,请不要遗漏任何细节。")
|
|
858
930
|
|
|
859
|
-
|
|
860
|
-
使用 /next 分析并建议后续步骤
|
|
861
|
-
使用例子:
|
|
862
|
-
|
|
863
|
-
coding(query="/next")
|
|
931
|
+
*** 但我们推荐你直接自己讲 chat 返回的有用的信息直接放到 query 里 *** 而不是通过 /apply 带入。
|
|
864
932
|
|
|
865
933
|
## 引用语法
|
|
866
934
|
- @文件名:引用特定文件
|
|
@@ -873,11 +941,11 @@ class CommandAutoTuner:
|
|
|
873
941
|
coding(query="@@login 优化错误处理")
|
|
874
942
|
coding(query="<img>design/flow.png</img> 实现这个流程图的功能")
|
|
875
943
|
|
|
876
|
-
|
|
944
|
+
特别注意,在使用 coding 函数时,通过 ask_user 来确认是否执行 coding 函数,除非用户明确说不要询问,直接执行。
|
|
877
945
|
</usage>
|
|
878
|
-
</
|
|
946
|
+
</function>
|
|
879
947
|
|
|
880
|
-
<
|
|
948
|
+
<function>
|
|
881
949
|
<name>lib</name>
|
|
882
950
|
<description>库管理命令,用于管理项目依赖和文档。</description>
|
|
883
951
|
<usage>
|
|
@@ -924,9 +992,9 @@ class CommandAutoTuner:
|
|
|
924
992
|
目前仅支持用于大模型的 byzer-llm 包,用于数据分析的 byzer-sql 包。
|
|
925
993
|
|
|
926
994
|
</usage>
|
|
927
|
-
</
|
|
995
|
+
</function>
|
|
928
996
|
|
|
929
|
-
<
|
|
997
|
+
<function>
|
|
930
998
|
<name>models</name>
|
|
931
999
|
<description>模型控制面板命令,用于管理和控制AI模型。</description>
|
|
932
1000
|
<usage>
|
|
@@ -1010,9 +1078,9 @@ class CommandAutoTuner:
|
|
|
1010
1078
|
|
|
1011
1079
|
|
|
1012
1080
|
</usage>
|
|
1013
|
-
</
|
|
1081
|
+
</function>
|
|
1014
1082
|
|
|
1015
|
-
<
|
|
1083
|
+
<function>
|
|
1016
1084
|
<name>ask_user</name>
|
|
1017
1085
|
<description>
|
|
1018
1086
|
如果你对用户的问题有什么疑问,或者你想从用户收集一些额外信息,可以调用此方法。
|
|
@@ -1026,9 +1094,9 @@ class CommandAutoTuner:
|
|
|
1026
1094
|
使用例子:
|
|
1027
1095
|
ask_user(question="请输入火山引擎的 R1 模型推理点")
|
|
1028
1096
|
|
|
1029
|
-
</
|
|
1097
|
+
</function>
|
|
1030
1098
|
|
|
1031
|
-
<
|
|
1099
|
+
<function>
|
|
1032
1100
|
<name>run_python</name>
|
|
1033
1101
|
<description>运行指定的Python代码。主要用于执行一些Python脚本或测试代码。</description>
|
|
1034
1102
|
<usage>
|
|
@@ -1043,9 +1111,9 @@ class CommandAutoTuner:
|
|
|
1043
1111
|
- 可以访问项目中的所有文件
|
|
1044
1112
|
- 输出结果会返回给用户
|
|
1045
1113
|
</usage>
|
|
1046
|
-
</
|
|
1114
|
+
</function>
|
|
1047
1115
|
|
|
1048
|
-
<
|
|
1116
|
+
<function>
|
|
1049
1117
|
<name>execute_shell_command</name>
|
|
1050
1118
|
<description>运行指定的Shell脚本。主要用于编译、运行、测试等任务。</description>
|
|
1051
1119
|
<usage>
|
|
@@ -1062,9 +1130,9 @@ class CommandAutoTuner:
|
|
|
1062
1130
|
- 输出结果会返回给用户
|
|
1063
1131
|
- 执行该命令的时候,需要通过 ask_user 询问用户是否同意执行,如果用户拒绝,则不再执行当前想执行的脚本呢。
|
|
1064
1132
|
</usage>
|
|
1065
|
-
</
|
|
1133
|
+
</function>
|
|
1066
1134
|
|
|
1067
|
-
<
|
|
1135
|
+
<function>
|
|
1068
1136
|
<name>generate_shell_command</name>
|
|
1069
1137
|
<description>
|
|
1070
1138
|
根据用户需求描述,生成shell脚本。
|
|
@@ -1074,10 +1142,10 @@ class CommandAutoTuner:
|
|
|
1074
1142
|
的看到生成的脚本。然后配合 ask_user, execute_shell_command 两个函数,最终完成
|
|
1075
1143
|
脚本执行。
|
|
1076
1144
|
</usage>
|
|
1077
|
-
</
|
|
1145
|
+
</function>
|
|
1078
1146
|
|
|
1079
1147
|
|
|
1080
|
-
<
|
|
1148
|
+
<function>
|
|
1081
1149
|
<name>get_project_structure</name>
|
|
1082
1150
|
<description>返回当前项目结构</description>
|
|
1083
1151
|
<usage>
|
|
@@ -1091,9 +1159,9 @@ class CommandAutoTuner:
|
|
|
1091
1159
|
感兴趣,可以配合 read_files 函数来读取文件内容,从而帮你做更好的决策
|
|
1092
1160
|
|
|
1093
1161
|
</usage>
|
|
1094
|
-
</
|
|
1162
|
+
</function>
|
|
1095
1163
|
|
|
1096
|
-
<
|
|
1164
|
+
<function>
|
|
1097
1165
|
<name>get_project_map</name>
|
|
1098
1166
|
<description>返回项目中指定文件包括文件用途、导入的包、定义的类、函数、变量等。</description>
|
|
1099
1167
|
<usage>
|
|
@@ -1116,9 +1184,9 @@ class CommandAutoTuner:
|
|
|
1116
1184
|
- 返回值为JSON格式文本
|
|
1117
1185
|
- 只能返回已被索引的文件
|
|
1118
1186
|
</usage>
|
|
1119
|
-
</
|
|
1187
|
+
</function>
|
|
1120
1188
|
|
|
1121
|
-
<
|
|
1189
|
+
<function>
|
|
1122
1190
|
<name>read_files</name>
|
|
1123
1191
|
<description>读取指定文件的内容(支持指定行范围),支持文件名或绝对路径。</description>
|
|
1124
1192
|
<usage>
|
|
@@ -1160,9 +1228,9 @@ class CommandAutoTuner:
|
|
|
1160
1228
|
特别注意:使用 read_files 时,一次性读取文件数量不要超过1个,每次只读取200行。如果发现读取的内容不够,则继续读取下面200行。
|
|
1161
1229
|
|
|
1162
1230
|
</usage>
|
|
1163
|
-
</
|
|
1231
|
+
</function>
|
|
1164
1232
|
|
|
1165
|
-
<
|
|
1233
|
+
<function>
|
|
1166
1234
|
<name>find_files_by_name</name>
|
|
1167
1235
|
<description>根据文件名中的关键字搜索文件。</description>
|
|
1168
1236
|
<usage>
|
|
@@ -1176,9 +1244,9 @@ class CommandAutoTuner:
|
|
|
1176
1244
|
- 搜索不区分大小写
|
|
1177
1245
|
- 返回所有匹配的文件路径,逗号分隔
|
|
1178
1246
|
</usage>
|
|
1179
|
-
</
|
|
1247
|
+
</function>
|
|
1180
1248
|
|
|
1181
|
-
<
|
|
1249
|
+
<function>
|
|
1182
1250
|
<name>find_files_by_content</name>
|
|
1183
1251
|
<description>根据文件内容中的关键字搜索文件。</description>
|
|
1184
1252
|
<usage>
|
|
@@ -1192,9 +1260,9 @@ class CommandAutoTuner:
|
|
|
1192
1260
|
- 搜索不区分大小写
|
|
1193
1261
|
- 如果结果过多,只返回前10个匹配项
|
|
1194
1262
|
</usage>
|
|
1195
|
-
</
|
|
1263
|
+
</function>
|
|
1196
1264
|
|
|
1197
|
-
<
|
|
1265
|
+
<function>
|
|
1198
1266
|
<name>read_file_with_keyword_ranges</name>
|
|
1199
1267
|
<description>读取包含指定关键字的行及其前后指定范围的行。</description>
|
|
1200
1268
|
<usage>
|
|
@@ -1223,9 +1291,9 @@ class CommandAutoTuner:
|
|
|
1223
1291
|
- 如果文件中有多个匹配的关键字,会返回多个内容块
|
|
1224
1292
|
- 搜索不区分大小写
|
|
1225
1293
|
</usage>
|
|
1226
|
-
</
|
|
1294
|
+
</function>
|
|
1227
1295
|
|
|
1228
|
-
<
|
|
1296
|
+
<function>
|
|
1229
1297
|
<name>conf_export</name>
|
|
1230
1298
|
<description>配置管理命令,用于管理和控制配置。</description>
|
|
1231
1299
|
<usage>
|
|
@@ -1235,9 +1303,9 @@ class CommandAutoTuner:
|
|
|
1235
1303
|
conf_export(path="导出路径,通常是.json文件")
|
|
1236
1304
|
|
|
1237
1305
|
</usage>
|
|
1238
|
-
</
|
|
1306
|
+
</function>
|
|
1239
1307
|
|
|
1240
|
-
<
|
|
1308
|
+
<function>
|
|
1241
1309
|
<name>conf_import</name>
|
|
1242
1310
|
<description>配置管理命令,用于管理和控制配置。</description>
|
|
1243
1311
|
<usage>
|
|
@@ -1247,9 +1315,9 @@ class CommandAutoTuner:
|
|
|
1247
1315
|
conf_import(path="导入路径,通常是.json文件")
|
|
1248
1316
|
|
|
1249
1317
|
</usage>
|
|
1250
|
-
</
|
|
1318
|
+
</function>
|
|
1251
1319
|
|
|
1252
|
-
<
|
|
1320
|
+
<function>
|
|
1253
1321
|
<name>index_export</name>
|
|
1254
1322
|
<description>索引管理命令,用于管理和控制索引。</description>
|
|
1255
1323
|
<usage>
|
|
@@ -1259,9 +1327,9 @@ class CommandAutoTuner:
|
|
|
1259
1327
|
index_export(path="导出路径,通常是.json文件")
|
|
1260
1328
|
|
|
1261
1329
|
</usage>
|
|
1262
|
-
</
|
|
1330
|
+
</function>
|
|
1263
1331
|
|
|
1264
|
-
<
|
|
1332
|
+
<function>
|
|
1265
1333
|
<name>index_import</name>
|
|
1266
1334
|
<description>索引管理命令,用于管理和控制索引。</description>
|
|
1267
1335
|
<usage>
|
|
@@ -1271,9 +1339,9 @@ class CommandAutoTuner:
|
|
|
1271
1339
|
index_import(path="导入路径,通常最后是.json文件")
|
|
1272
1340
|
|
|
1273
1341
|
</usage>
|
|
1274
|
-
</
|
|
1342
|
+
</function>
|
|
1275
1343
|
|
|
1276
|
-
<
|
|
1344
|
+
<function>
|
|
1277
1345
|
<name>exclude_files</name>
|
|
1278
1346
|
<description>排除指定文件。</description>
|
|
1279
1347
|
<usage>
|
|
@@ -1295,9 +1363,9 @@ class CommandAutoTuner:
|
|
|
1295
1363
|
exclude_files(query="/list")
|
|
1296
1364
|
exclude_files(query="/drop regex://.*/package-lock\.json")
|
|
1297
1365
|
</usage>
|
|
1298
|
-
</
|
|
1366
|
+
</function>
|
|
1299
1367
|
|
|
1300
|
-
<
|
|
1368
|
+
<function>
|
|
1301
1369
|
<name>get_project_type</name>
|
|
1302
1370
|
<description>获取项目类型。</description>
|
|
1303
1371
|
<usage>
|
|
@@ -1308,9 +1376,9 @@ class CommandAutoTuner:
|
|
|
1308
1376
|
|
|
1309
1377
|
此时会返回诸如 "ts,py,java,go,js,ts" 这样的字符串,表示项目类型。
|
|
1310
1378
|
</usage>
|
|
1311
|
-
</
|
|
1379
|
+
</function>
|
|
1312
1380
|
|
|
1313
|
-
<
|
|
1381
|
+
<function>
|
|
1314
1382
|
<name>response_user</name>
|
|
1315
1383
|
<description>响应用户。</description>
|
|
1316
1384
|
<usage>
|
|
@@ -1320,9 +1388,9 @@ class CommandAutoTuner:
|
|
|
1320
1388
|
你可以通过如下方式来回答:
|
|
1321
1389
|
response_user(response="你好,我是 auto-coder")
|
|
1322
1390
|
</usage>
|
|
1323
|
-
</
|
|
1391
|
+
</function>
|
|
1324
1392
|
|
|
1325
|
-
<
|
|
1393
|
+
<function>
|
|
1326
1394
|
<name>count_file_tokens</name>
|
|
1327
1395
|
<description>计算指定文件的token数量。</description>
|
|
1328
1396
|
<usage>
|
|
@@ -1335,9 +1403,9 @@ class CommandAutoTuner:
|
|
|
1335
1403
|
- 返回值为int类型,表示文件的token数量。
|
|
1336
1404
|
|
|
1337
1405
|
</usage>
|
|
1338
|
-
</
|
|
1406
|
+
</function>
|
|
1339
1407
|
|
|
1340
|
-
<
|
|
1408
|
+
<function>
|
|
1341
1409
|
<name>count_string_tokens</name>
|
|
1342
1410
|
<description>计算指定字符串的token数量。</description>
|
|
1343
1411
|
<usage>
|
|
@@ -1350,9 +1418,9 @@ class CommandAutoTuner:
|
|
|
1350
1418
|
- 返回值为int类型,表示文本的token数量。
|
|
1351
1419
|
|
|
1352
1420
|
</usage>
|
|
1353
|
-
</
|
|
1421
|
+
</function>
|
|
1354
1422
|
|
|
1355
|
-
<
|
|
1423
|
+
<function>
|
|
1356
1424
|
<n>find_symbol_definition</n>
|
|
1357
1425
|
<description>查找指定符号的定义所在的文件路径。</description>
|
|
1358
1426
|
<usage>
|
|
@@ -1368,9 +1436,9 @@ class CommandAutoTuner:
|
|
|
1368
1436
|
- 如果未找到匹配项,会返回提示信息
|
|
1369
1437
|
|
|
1370
1438
|
</usage>
|
|
1371
|
-
</
|
|
1439
|
+
</function>
|
|
1372
1440
|
|
|
1373
|
-
<
|
|
1441
|
+
<function>
|
|
1374
1442
|
<n>execute_mcp_server</n>
|
|
1375
1443
|
<description>执行MCP服务器</description>
|
|
1376
1444
|
<usage>
|
|
@@ -1384,7 +1452,7 @@ class CommandAutoTuner:
|
|
|
1384
1452
|
</mcp_server_info>
|
|
1385
1453
|
|
|
1386
1454
|
</usage>
|
|
1387
|
-
</
|
|
1455
|
+
</function>
|
|
1388
1456
|
'''
|
|
1389
1457
|
return {
|
|
1390
1458
|
"config_readme": config_readme.prompt(),
|