auto-coder 0.1.233__tar.gz → 0.1.235__tar.gz
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.233 → auto_coder-0.1.235}/PKG-INFO +1 -2
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/auto_coder.egg-info/PKG-INFO +1 -2
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/auto_coder.egg-info/SOURCES.txt +2 -1
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/auto_coder.egg-info/requires.txt +0 -1
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/auto_coder.py +65 -33
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/chat_auto_coder.py +29 -1
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/__init__.py +3 -0
- {auto_coder-0.1.233/src/autocoder → auto_coder-0.1.235/src/autocoder/common}/auto_coder_lang.py +33 -3
- auto_coder-0.1.235/src/autocoder/common/printer.py +36 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/dispacher/actions/action.py +17 -1
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +5 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/entry.py +39 -9
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/filter/quick_filter.py +7 -6
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/index.py +54 -16
- auto_coder-0.1.235/src/autocoder/version.py +1 -0
- auto_coder-0.1.233/src/autocoder/version.py +0 -1
- {auto_coder-0.1.233 → auto_coder-0.1.235}/LICENSE +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/README.md +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/setup.cfg +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/setup.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/auto_coder_rag_client_mcp.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/auto_coder_rag_mcp.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_generate.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/common/utils_code_auto_generate.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/tests/test_planner.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.233 → auto_coder-0.1.235}/tests/test_symbols_utils.py +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.235
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -39,7 +39,6 @@ Requires-Dist: real_agent
|
|
|
39
39
|
Requires-Dist: python-docx
|
|
40
40
|
Requires-Dist: docx2txt
|
|
41
41
|
Requires-Dist: pdf2image
|
|
42
|
-
Requires-Dist: Spire.Doc
|
|
43
42
|
Requires-Dist: docx2pdf
|
|
44
43
|
Requires-Dist: pyperclip
|
|
45
44
|
Requires-Dist: colorama
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.235
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -39,7 +39,6 @@ Requires-Dist: real_agent
|
|
|
39
39
|
Requires-Dist: python-docx
|
|
40
40
|
Requires-Dist: docx2txt
|
|
41
41
|
Requires-Dist: pdf2image
|
|
42
|
-
Requires-Dist: Spire.Doc
|
|
43
42
|
Requires-Dist: docx2pdf
|
|
44
43
|
Requires-Dist: pyperclip
|
|
45
44
|
Requires-Dist: colorama
|
|
@@ -9,7 +9,6 @@ src/auto_coder.egg-info/requires.txt
|
|
|
9
9
|
src/auto_coder.egg-info/top_level.txt
|
|
10
10
|
src/autocoder/__init__.py
|
|
11
11
|
src/autocoder/auto_coder.py
|
|
12
|
-
src/autocoder/auto_coder_lang.py
|
|
13
12
|
src/autocoder/auto_coder_rag.py
|
|
14
13
|
src/autocoder/auto_coder_rag_client_mcp.py
|
|
15
14
|
src/autocoder/auto_coder_rag_mcp.py
|
|
@@ -37,6 +36,7 @@ src/autocoder/common/__init__.py
|
|
|
37
36
|
src/autocoder/common/anything2images.py
|
|
38
37
|
src/autocoder/common/anything2img.py
|
|
39
38
|
src/autocoder/common/audio.py
|
|
39
|
+
src/autocoder/common/auto_coder_lang.py
|
|
40
40
|
src/autocoder/common/buildin_tokenizer.py
|
|
41
41
|
src/autocoder/common/chunk_validation.py
|
|
42
42
|
src/autocoder/common/cleaner.py
|
|
@@ -63,6 +63,7 @@ src/autocoder/common/mcp_hub.py
|
|
|
63
63
|
src/autocoder/common/mcp_server.py
|
|
64
64
|
src/autocoder/common/mcp_tools.py
|
|
65
65
|
src/autocoder/common/memory_manager.py
|
|
66
|
+
src/autocoder/common/printer.py
|
|
66
67
|
src/autocoder/common/recall_validation.py
|
|
67
68
|
src/autocoder/common/screenshots.py
|
|
68
69
|
src/autocoder/common/search.py
|
|
@@ -39,7 +39,7 @@ from rich.console import Console
|
|
|
39
39
|
from rich.panel import Panel
|
|
40
40
|
from rich.markdown import Markdown
|
|
41
41
|
from rich.live import Live
|
|
42
|
-
from autocoder.auto_coder_lang import get_message
|
|
42
|
+
from autocoder.common.auto_coder_lang import get_message
|
|
43
43
|
from autocoder.common.memory_manager import save_to_memory_file
|
|
44
44
|
from autocoder import models as models_module
|
|
45
45
|
from autocoder.common.utils_code_auto_generate import stream_chat_with_continue
|
|
@@ -69,8 +69,7 @@ def load_include_files(config, base_path, max_depth=10, current_depth=0):
|
|
|
69
69
|
include_files = [include_files]
|
|
70
70
|
|
|
71
71
|
for include_file in include_files:
|
|
72
|
-
abs_include_path = resolve_include_path(base_path, include_file)
|
|
73
|
-
logger.info(f"Loading include file: {abs_include_path}")
|
|
72
|
+
abs_include_path = resolve_include_path(base_path, include_file)
|
|
74
73
|
with open(abs_include_path, "r") as f:
|
|
75
74
|
include_config = yaml.safe_load(f)
|
|
76
75
|
if not include_config:
|
|
@@ -131,15 +130,15 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
131
130
|
if not os.path.isabs(args.source_dir):
|
|
132
131
|
args.source_dir = os.path.abspath(args.source_dir)
|
|
133
132
|
|
|
134
|
-
if not args.silence:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
# if not args.silence:
|
|
134
|
+
# print("Command Line Arguments:")
|
|
135
|
+
# print("-" * 50)
|
|
136
|
+
# for arg, value in vars(args).items():
|
|
137
|
+
# if arg == "context" and value:
|
|
138
|
+
# print(f"{arg:20}: {value[:30]}...")
|
|
139
|
+
# else:
|
|
140
|
+
# print(f"{arg:20}: {value}")
|
|
141
|
+
# print("-" * 50)
|
|
143
142
|
|
|
144
143
|
# init store
|
|
145
144
|
store = Store(os.path.join(args.source_dir, ".auto-coder", "metadata.db"))
|
|
@@ -244,10 +243,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
244
243
|
new_file = os.path.join(
|
|
245
244
|
actions_dir, f"{new_seq}_{raw_args.name}.yml")
|
|
246
245
|
with open(new_file, "w") as f:
|
|
247
|
-
f.write(content)
|
|
248
|
-
|
|
249
|
-
print(f"Successfully created new action file: {new_file}")
|
|
250
|
-
|
|
246
|
+
f.write(content)
|
|
251
247
|
# open_yaml_file_in_editor(new_file)
|
|
252
248
|
return
|
|
253
249
|
|
|
@@ -281,6 +277,22 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
281
277
|
byzerllm.connect_cluster(address=args.ray_address)
|
|
282
278
|
|
|
283
279
|
llm = byzerllm.ByzerLLM(verbose=args.print_request)
|
|
280
|
+
|
|
281
|
+
code_model = byzerllm.ByzerLLM()
|
|
282
|
+
code_model.setup_default_model_name("deepseek_chat")
|
|
283
|
+
llm.setup_sub_client("code_model", code_model)
|
|
284
|
+
|
|
285
|
+
index_filter_model = byzerllm.ByzerLLM()
|
|
286
|
+
index_filter_model.setup_default_model_name("deepseek_r1_chat")
|
|
287
|
+
llm.setup_sub_client("index_filter_model", index_filter_model)
|
|
288
|
+
|
|
289
|
+
generate_rerank_model = byzerllm.ByzerLLM()
|
|
290
|
+
generate_rerank_model.setup_default_model_name("deepseek_r1_chat")
|
|
291
|
+
llm.setup_sub_client("generate_rerank_model", generate_rerank_model)
|
|
292
|
+
|
|
293
|
+
chat_model = byzerllm.ByzerLLM()
|
|
294
|
+
chat_model.setup_default_model_name("deepseek_r1_chat")
|
|
295
|
+
llm.setup_sub_client("chat_model", chat_model)
|
|
284
296
|
|
|
285
297
|
if args.product_mode == "lite":
|
|
286
298
|
llm = byzerllm.SimpleByzerLLM(default_model_name="deepseek_chat")
|
|
@@ -344,9 +356,23 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
344
356
|
}
|
|
345
357
|
)
|
|
346
358
|
|
|
359
|
+
index_filter_llm = byzerllm.SimpleByzerLLM(default_model_name="deepseek_r1_chat")
|
|
360
|
+
index_filter_llm.deploy(
|
|
361
|
+
model_path="",
|
|
362
|
+
pretrained_model_type="saas/openai",
|
|
363
|
+
udf_name="deepseek_r1_chat",
|
|
364
|
+
infer_params={
|
|
365
|
+
"saas.base_url": "https://api.deepseek.com/v1",
|
|
366
|
+
"saas.api_key": api_key,
|
|
367
|
+
"saas.model": "deepseek-reasoner",
|
|
368
|
+
"saas.is_reasoning": True
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
|
|
347
372
|
llm.setup_sub_client("code_model", code_llm)
|
|
348
373
|
llm.setup_sub_client("chat_model", chat_llm)
|
|
349
374
|
llm.setup_sub_client("generate_rerank_model", generate_rerank_llm)
|
|
375
|
+
llm.setup_sub_client("index_filter_model", index_filter_llm)
|
|
350
376
|
|
|
351
377
|
if args.product_mode == "lite":
|
|
352
378
|
# Set up default models based on configuration
|
|
@@ -444,7 +470,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
444
470
|
"saas.is_reasoning": model_info["is_reasoning"]
|
|
445
471
|
}
|
|
446
472
|
)
|
|
447
|
-
llm.setup_sub_client("inference_model", inference_model)
|
|
473
|
+
llm.setup_sub_client("inference_model", inference_model)
|
|
448
474
|
|
|
449
475
|
if args.index_filter_model:
|
|
450
476
|
model_info = models_module.get_model_by_name(args.index_filter_model)
|
|
@@ -1114,20 +1140,25 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1114
1140
|
chat_llm = llm
|
|
1115
1141
|
|
|
1116
1142
|
source_count = 0
|
|
1117
|
-
pre_conversations = []
|
|
1118
|
-
if args.context
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1143
|
+
pre_conversations = []
|
|
1144
|
+
context_content = args.context if args.context else ""
|
|
1145
|
+
if args.context:
|
|
1146
|
+
try:
|
|
1147
|
+
context = json.loads(args.context)
|
|
1148
|
+
if "file_content" in context:
|
|
1149
|
+
context_content = context["file_content"]
|
|
1150
|
+
except:
|
|
1151
|
+
pass
|
|
1152
|
+
|
|
1153
|
+
pre_conversations.append(
|
|
1154
|
+
{
|
|
1155
|
+
"role": "user",
|
|
1156
|
+
"content": f"请阅读下面的代码和文档:\n\n <files>\n{context_content}\n</files>",
|
|
1157
|
+
},
|
|
1158
|
+
)
|
|
1159
|
+
pre_conversations.append(
|
|
1160
|
+
{"role": "assistant", "content": "read"})
|
|
1161
|
+
source_count += 1
|
|
1131
1162
|
|
|
1132
1163
|
from autocoder.index.index import IndexManager
|
|
1133
1164
|
from autocoder.index.entry import build_index_and_filter_files
|
|
@@ -1142,10 +1173,11 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1142
1173
|
else:
|
|
1143
1174
|
pp = SuffixProject(args=args, llm=llm, file_filter=None)
|
|
1144
1175
|
pp.run()
|
|
1145
|
-
sources = pp.sources
|
|
1176
|
+
sources = pp.sources
|
|
1146
1177
|
|
|
1147
1178
|
s = build_index_and_filter_files(
|
|
1148
|
-
llm=llm, args=args, sources=sources)
|
|
1179
|
+
llm=llm, args=args, sources=sources)
|
|
1180
|
+
|
|
1149
1181
|
if s:
|
|
1150
1182
|
pre_conversations.append(
|
|
1151
1183
|
{
|
|
@@ -370,6 +370,33 @@ def initialize_system(args):
|
|
|
370
370
|
"deepseek_chat",
|
|
371
371
|
]
|
|
372
372
|
|
|
373
|
+
try:
|
|
374
|
+
subprocess.run(deploy_cmd, check=True)
|
|
375
|
+
print_status(get_message("deploy_complete"), "success")
|
|
376
|
+
except subprocess.CalledProcessError:
|
|
377
|
+
print_status(get_message("deploy_fail"), "error")
|
|
378
|
+
return
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
deploy_cmd = [
|
|
382
|
+
"byzerllm",
|
|
383
|
+
"deploy",
|
|
384
|
+
"--pretrained_model_type",
|
|
385
|
+
"saas/reasoning_openai",
|
|
386
|
+
"--cpus_per_worker",
|
|
387
|
+
"0.001",
|
|
388
|
+
"--gpus_per_worker",
|
|
389
|
+
"0",
|
|
390
|
+
"--worker_concurrency",
|
|
391
|
+
"1000",
|
|
392
|
+
"--num_workers",
|
|
393
|
+
"1",
|
|
394
|
+
"--infer_params",
|
|
395
|
+
f"saas.base_url=https://api.deepseek.com/v1 saas.api_key={api_key} saas.model=deepseek-reasoner",
|
|
396
|
+
"--model",
|
|
397
|
+
"deepseek_r1_chat",
|
|
398
|
+
]
|
|
399
|
+
|
|
373
400
|
try:
|
|
374
401
|
subprocess.run(deploy_cmd, check=True)
|
|
375
402
|
print_status(get_message("deploy_complete"), "success")
|
|
@@ -1715,7 +1742,8 @@ def coding(query: str):
|
|
|
1715
1742
|
== "true",
|
|
1716
1743
|
}
|
|
1717
1744
|
|
|
1718
|
-
yaml_config["context"] = ""
|
|
1745
|
+
yaml_config["context"] = ""
|
|
1746
|
+
yaml_config["in_code_apply"] = is_apply
|
|
1719
1747
|
|
|
1720
1748
|
for key, value in conf.items():
|
|
1721
1749
|
converted_value = convert_config_value(key, value)
|
{auto_coder-0.1.233/src/autocoder → auto_coder-0.1.235/src/autocoder/common}/auto_coder_lang.py
RENAMED
|
@@ -2,6 +2,15 @@ import locale
|
|
|
2
2
|
|
|
3
3
|
MESSAGES = {
|
|
4
4
|
"en": {
|
|
5
|
+
"index_file_too_large": "⚠️ File {{ file_path }} is too large ({{ file_size }} > {{ max_length }}), splitting into chunks...",
|
|
6
|
+
"index_update_success": "✅ Successfully updated index for {{ file_path }} (md5: {{ md5 }}) in {{ duration }}s",
|
|
7
|
+
"index_build_error": "❌ Error building index for {{ file_path }}: {{ error }}",
|
|
8
|
+
"index_build_summary": "📊 Total Files: {{ total_files }}, Need to Build Index: {{ num_files }}",
|
|
9
|
+
"building_index_progress": "⏳ Building Index: {{ counter }}/{{ num_files }}...",
|
|
10
|
+
"index_source_dir_mismatch": "⚠️ Source directory mismatch (file_path: {{ file_path }}, source_dir: {{ source_dir }})",
|
|
11
|
+
"index_related_files_fail": "⚠️ Failed to find related files for chunk {{ chunk_count }}",
|
|
12
|
+
"index_threads_completed": "✅ Completed {{ completed_threads }}/{{ total_threads }} threads",
|
|
13
|
+
"index_related_files_fail": "⚠️ Failed to find related files for chunk {{ chunk_count }}",
|
|
5
14
|
"human_as_model_instructions": (
|
|
6
15
|
"You are now in Human as Model mode. The content has been copied to your clipboard.\n"
|
|
7
16
|
"The system is waiting for your input. When finished, enter 'EOF' on a new line to submit.\n"
|
|
@@ -16,6 +25,10 @@ MESSAGES = {
|
|
|
16
25
|
"The system is waiting for your input. When finished, enter 'EOF' on a new line to submit.\n"
|
|
17
26
|
"Use '/break' to exit this mode. If you have issues with copy-paste, use '/clear' to clean and paste again."
|
|
18
27
|
),
|
|
28
|
+
"phase1_processing_sources": "Phase 1: Processing REST/RAG/Search sources...",
|
|
29
|
+
"phase2_building_index": "Phase 2: Building index for all files...",
|
|
30
|
+
"phase6_file_selection": "Phase 6: Processing file selection and limits...",
|
|
31
|
+
"phase7_preparing_output": "Phase 7: Preparing final output...",
|
|
19
32
|
"chat_human_as_model_instructions": (
|
|
20
33
|
"Chat is now in Human as Model mode.\n"
|
|
21
34
|
"The question has been copied to your clipboard.\n"
|
|
@@ -25,6 +38,15 @@ MESSAGES = {
|
|
|
25
38
|
)
|
|
26
39
|
},
|
|
27
40
|
"zh": {
|
|
41
|
+
"index_file_too_large": "⚠️ 文件 {{ file_path }} 过大 ({{ file_size }} > {{ max_length }}), 正在分块处理...",
|
|
42
|
+
"index_update_success": "✅ 成功更新 {{ file_path }} 的索引 (md5: {{ md5 }}), 耗时 {{ duration }} 秒",
|
|
43
|
+
"index_build_error": "❌ 构建 {{ file_path }} 索引时出错: {{ error }}",
|
|
44
|
+
"index_build_summary": "📊 总文件数: {{ total_files }}, 需要构建索引: {{ num_files }}",
|
|
45
|
+
"building_index_progress": "⏳ 正在构建索引: {{ counter }}/{{ num_files }}...",
|
|
46
|
+
"index_source_dir_mismatch": "⚠️ 源目录不匹配 (文件路径: {{ file_path }}, 源目录: {{ source_dir }})",
|
|
47
|
+
"index_related_files_fail": "⚠️ 无法为块 {{ chunk_count }} 找到相关文件",
|
|
48
|
+
"index_threads_completed": "✅ 已完成 {{ completed_threads }}/{{ total_threads }} 个线程",
|
|
49
|
+
"index_related_files_fail": "⚠️ 无法为块 {{ chunk_count }} 找到相关文件",
|
|
28
50
|
"human_as_model_instructions": (
|
|
29
51
|
"您现在处于人类作为模型模式。内容已复制到您的剪贴板。\n"
|
|
30
52
|
"系统正在等待您的输入。完成后,在新行输入'EOF'提交。\n"
|
|
@@ -39,22 +61,30 @@ MESSAGES = {
|
|
|
39
61
|
"系统正在等待您的输入。完成后,在新行输入'EOF'提交。\n"
|
|
40
62
|
"使用'/break'退出此模式。如果复制粘贴有问题,使用'/clear'清理并重新粘贴。"
|
|
41
63
|
),
|
|
64
|
+
|
|
65
|
+
"phase1_processing_sources": "阶段 1: 正在处理 REST/RAG/Search 源...",
|
|
66
|
+
"phase2_building_index": "阶段 2: 正在为所有文件构建索引...",
|
|
67
|
+
"phase6_file_selection": "阶段 6: 正在处理文件选择和限制...",
|
|
68
|
+
"phase7_preparing_output": "阶段 7: 正在准备最终输出...",
|
|
69
|
+
|
|
42
70
|
"chat_human_as_model_instructions": (
|
|
43
71
|
"\n============= Chat 处于 Human as Model 模式 =============\n"
|
|
44
72
|
"问题已复制到剪贴板\n"
|
|
45
73
|
"请使用Web版本模型获取答案\n"
|
|
46
|
-
"或者使用 /conf human_as_model:false 关闭该模式直接在终端获得答案。"
|
|
47
|
-
"将获得答案黏贴到下面的输入框,换行后,使用 '/break' 退出,'/clear' 清屏,'/eof' 提交。"
|
|
74
|
+
"或者使用 /conf human_as_model:false 关闭该模式直接在终端获得答案。"
|
|
75
|
+
"将获得答案黏贴到下面的输入框,换行后,使用 '/break' 退出,'/clear' 清屏,'/eof' 提交。"
|
|
48
76
|
),
|
|
49
77
|
}
|
|
50
78
|
}
|
|
51
79
|
|
|
80
|
+
|
|
52
81
|
def get_system_language():
|
|
53
82
|
try:
|
|
54
83
|
return locale.getdefaultlocale()[0][:2]
|
|
55
84
|
except:
|
|
56
85
|
return 'en'
|
|
57
86
|
|
|
87
|
+
|
|
58
88
|
def get_message(key):
|
|
59
89
|
lang = get_system_language()
|
|
60
|
-
return MESSAGES.get(lang, MESSAGES['en']).get(key, MESSAGES['en'][key])
|
|
90
|
+
return MESSAGES.get(lang, MESSAGES['en']).get(key, MESSAGES['en'][key])
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from rich.console import Console
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from byzerllm.utils import format_str_jinja2
|
|
4
|
+
from autocoder.common.auto_coder_lang import get_message
|
|
5
|
+
from autocoder.chat_auto_coder_lang import get_message as get_chat_message
|
|
6
|
+
class Printer:
|
|
7
|
+
def __init__(self,console:Optional[Console]=None):
|
|
8
|
+
if console is None:
|
|
9
|
+
self.console = Console()
|
|
10
|
+
else:
|
|
11
|
+
self.console = console
|
|
12
|
+
|
|
13
|
+
def get_message_from_key(self, key: str):
|
|
14
|
+
try:
|
|
15
|
+
return get_message(key)
|
|
16
|
+
except Exception as e:
|
|
17
|
+
return get_chat_message(key)
|
|
18
|
+
|
|
19
|
+
def print_in_terminal(self, key: str, style: str = None,**kwargs):
|
|
20
|
+
try:
|
|
21
|
+
if style:
|
|
22
|
+
self.console.print(format_str_jinja2(self.get_message_from_key(key),**kwargs), style=style)
|
|
23
|
+
else:
|
|
24
|
+
self.console.print(format_str_jinja2(self.get_message_from_key(key),**kwargs))
|
|
25
|
+
except Exception as e:
|
|
26
|
+
print(self.get_message_from_key(key))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def print_str_in_terminal(self, content: str, style: str = None):
|
|
30
|
+
try:
|
|
31
|
+
if style:
|
|
32
|
+
self.console.print(content, style=style)
|
|
33
|
+
else:
|
|
34
|
+
self.console.print(content)
|
|
35
|
+
except Exception as e:
|
|
36
|
+
print(content)
|
|
@@ -54,9 +54,14 @@ class ActionTSProject(BaseAction):
|
|
|
54
54
|
|
|
55
55
|
source_code = pp.output()
|
|
56
56
|
if self.llm:
|
|
57
|
+
if args.in_code_apply:
|
|
58
|
+
old_query = args.query
|
|
59
|
+
args.query = (args.context or "") + "\n\n" + args.query
|
|
57
60
|
source_code = build_index_and_filter_files(
|
|
58
61
|
llm=self.llm, args=args, sources=pp.sources
|
|
59
62
|
)
|
|
63
|
+
if args.in_code_apply:
|
|
64
|
+
args.query = old_query
|
|
60
65
|
|
|
61
66
|
if args.image_file:
|
|
62
67
|
if args.image_mode == "iterative":
|
|
@@ -256,11 +261,17 @@ class ActionPyProject(BaseAction):
|
|
|
256
261
|
pp = PyProject(args=self.args, llm=self.llm)
|
|
257
262
|
self.pp = pp
|
|
258
263
|
pp.run(packages=args.py_packages.split(",") if args.py_packages else [])
|
|
259
|
-
source_code = pp.output()
|
|
264
|
+
source_code = pp.output()
|
|
265
|
+
|
|
260
266
|
if self.llm:
|
|
267
|
+
old_query = args.query
|
|
268
|
+
if args.in_code_apply:
|
|
269
|
+
args.query = (args.context or "") + "\n\n" + args.query
|
|
261
270
|
source_code = build_index_and_filter_files(
|
|
262
271
|
llm=self.llm, args=args, sources=pp.sources
|
|
263
272
|
)
|
|
273
|
+
if args.in_code_apply:
|
|
274
|
+
args.query = old_query
|
|
264
275
|
|
|
265
276
|
self.process_content(source_code)
|
|
266
277
|
return True
|
|
@@ -355,9 +366,14 @@ class ActionSuffixProject(BaseAction):
|
|
|
355
366
|
pp.run()
|
|
356
367
|
source_code = pp.output()
|
|
357
368
|
if self.llm:
|
|
369
|
+
if args.in_code_apply:
|
|
370
|
+
old_query = args.query
|
|
371
|
+
args.query = (args.context or "") + "\n\n" + args.query
|
|
358
372
|
source_code = build_index_and_filter_files(
|
|
359
373
|
llm=self.llm, args=args, sources=pp.sources
|
|
360
374
|
)
|
|
375
|
+
if args.in_code_apply:
|
|
376
|
+
args.query = old_query
|
|
361
377
|
self.process_content(source_code)
|
|
362
378
|
|
|
363
379
|
def process_content(self, content: str):
|
|
@@ -36,9 +36,14 @@ class ActionRegexProject:
|
|
|
36
36
|
pp.run()
|
|
37
37
|
source_code = pp.output()
|
|
38
38
|
if self.llm:
|
|
39
|
+
if args.in_code_apply:
|
|
40
|
+
old_query = args.query
|
|
41
|
+
args.query = (args.context or "") + "\n\n" + args.query
|
|
39
42
|
source_code = build_index_and_filter_files(
|
|
40
43
|
llm=self.llm, args=args, sources=pp.sources
|
|
41
44
|
)
|
|
45
|
+
if args.in_code_apply:
|
|
46
|
+
args.query = old_query
|
|
42
47
|
self.process_content(source_code)
|
|
43
48
|
|
|
44
49
|
def process_content(self, content: str):
|
|
@@ -9,7 +9,7 @@ from rich.console import Console
|
|
|
9
9
|
from rich.table import Table
|
|
10
10
|
from rich.panel import Panel
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from autocoder.common.printer import Printer
|
|
13
13
|
from autocoder.utils.queue_communicate import (
|
|
14
14
|
queue_communicate,
|
|
15
15
|
CommunicateEvent,
|
|
@@ -58,7 +58,8 @@ def build_index_and_filter_files(
|
|
|
58
58
|
final_files: Dict[str, TargetFile] = {}
|
|
59
59
|
|
|
60
60
|
# Phase 1: Process REST/RAG/Search sources
|
|
61
|
-
|
|
61
|
+
printer = Printer()
|
|
62
|
+
printer.print_in_terminal("phase1_processing_sources")
|
|
62
63
|
phase_start = time.monotonic()
|
|
63
64
|
for source in sources:
|
|
64
65
|
if source.tag in ["REST", "RAG", "SEARCH"]:
|
|
@@ -79,7 +80,7 @@ def build_index_and_filter_files(
|
|
|
79
80
|
)
|
|
80
81
|
)
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
printer.print_in_terminal("phase2_building_index")
|
|
83
84
|
phase_start = time.monotonic()
|
|
84
85
|
index_manager = IndexManager(llm=llm, sources=sources, args=args)
|
|
85
86
|
index_data = index_manager.build_index()
|
|
@@ -133,19 +134,48 @@ def build_index_and_filter_files(
|
|
|
133
134
|
|
|
134
135
|
return [file for file in result] if result else []
|
|
135
136
|
|
|
137
|
+
def shorten_path(path: str, keep_levels: int = 3) -> str:
|
|
138
|
+
"""
|
|
139
|
+
优化长路径显示,保留最后指定层级
|
|
140
|
+
示例:/a/b/c/d/e/f.py -> .../c/d/e/f.py
|
|
141
|
+
"""
|
|
142
|
+
parts = path.split(os.sep)
|
|
143
|
+
if len(parts) > keep_levels:
|
|
144
|
+
return ".../" + os.sep.join(parts[-keep_levels:])
|
|
145
|
+
return path
|
|
146
|
+
|
|
136
147
|
def print_selected(data):
|
|
137
148
|
console = Console()
|
|
149
|
+
|
|
150
|
+
# 获取终端宽度
|
|
151
|
+
console_width = console.width
|
|
138
152
|
|
|
139
153
|
table = Table(
|
|
140
154
|
title="Files Used as Context",
|
|
141
155
|
show_header=True,
|
|
142
156
|
header_style="bold magenta",
|
|
157
|
+
# 设置表格最大宽度为终端宽度(留 10 字符边距)
|
|
158
|
+
width=min(console_width - 10, 120),
|
|
159
|
+
expand=True
|
|
143
160
|
)
|
|
144
|
-
|
|
145
|
-
|
|
161
|
+
|
|
162
|
+
# 优化列配置
|
|
163
|
+
table.add_column("File Path",
|
|
164
|
+
style="cyan",
|
|
165
|
+
width=int((console_width - 10) * 0.6), # 分配 60% 宽度给文件路径
|
|
166
|
+
overflow="fold", # 自动折叠过长的路径
|
|
167
|
+
no_wrap=False) # 允许换行
|
|
168
|
+
|
|
169
|
+
table.add_column("Reason",
|
|
170
|
+
style="green",
|
|
171
|
+
width=int((console_width - 10) * 0.4), # 分配 40% 宽度给原因
|
|
172
|
+
no_wrap=False)
|
|
146
173
|
|
|
174
|
+
# 添加处理过的文件路径
|
|
147
175
|
for file, reason in data:
|
|
148
|
-
|
|
176
|
+
# 路径截取优化:保留最后 3 级路径
|
|
177
|
+
processed_path = shorten_path(file, keep_levels=3)
|
|
178
|
+
table.add_row(processed_path, reason)
|
|
149
179
|
|
|
150
180
|
panel = Panel(
|
|
151
181
|
table,
|
|
@@ -157,7 +187,7 @@ def build_index_and_filter_files(
|
|
|
157
187
|
console.print(panel)
|
|
158
188
|
|
|
159
189
|
# Phase 6: File selection and limitation
|
|
160
|
-
|
|
190
|
+
printer.print_in_terminal("phase6_file_selection")
|
|
161
191
|
phase_start = time.monotonic()
|
|
162
192
|
|
|
163
193
|
if args.index_filter_file_num > 0:
|
|
@@ -188,7 +218,7 @@ def build_index_and_filter_files(
|
|
|
188
218
|
stats["timings"]["file_selection"] = phase_end - phase_start
|
|
189
219
|
|
|
190
220
|
# Phase 7: Display results and prepare output
|
|
191
|
-
|
|
221
|
+
printer.print_in_terminal("phase7_preparing_output")
|
|
192
222
|
phase_start = time.monotonic()
|
|
193
223
|
try:
|
|
194
224
|
print_selected(
|
|
@@ -269,7 +299,7 @@ def build_index_and_filter_files(
|
|
|
269
299
|
• Total time: {total_time:.2f}s
|
|
270
300
|
====================================
|
|
271
301
|
"""
|
|
272
|
-
|
|
302
|
+
printer.print_str_in_terminal(summary)
|
|
273
303
|
|
|
274
304
|
if args.request_id and not args.skip_events:
|
|
275
305
|
queue_communicate.send_event(
|
|
@@ -55,7 +55,10 @@ class QuickFilter():
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
特别注意
|
|
59
|
+
1. 如果用户的query里 @文件 或者 @@符号,那么被@的文件或者@@的符号必须要返回,并且查看他们依赖的文件是否相关。
|
|
60
|
+
2. 如果 query 里是一段历史对话,那么对话里的内容提及的文件路径必须要返回。
|
|
61
|
+
3. json格式数据不允许有注释
|
|
59
62
|
'''
|
|
60
63
|
file_meta_str = "\n".join([f"##[{index}]{item.module_name}\n{item.symbols}" for index,item in enumerate(file_meta_list)])
|
|
61
64
|
context = {
|
|
@@ -66,15 +69,13 @@ class QuickFilter():
|
|
|
66
69
|
|
|
67
70
|
def filter(self, index_items: List[IndexItem], query: str) -> Dict[str, TargetFile]:
|
|
68
71
|
final_files: Dict[str, TargetFile] = {}
|
|
69
|
-
if not self.args.skip_filter_index and self.
|
|
72
|
+
if not self.args.skip_filter_index and self.index_manager.llm.get_sub_client("index_filter_model"):
|
|
70
73
|
start_time = time.monotonic()
|
|
71
74
|
index_items = self.index_manager.read_index()
|
|
72
75
|
|
|
73
|
-
prompt_str = self.quick_filter_files.prompt(index_items,query)
|
|
74
|
-
|
|
75
|
-
print(prompt_str)
|
|
76
|
+
prompt_str = self.quick_filter_files.prompt(index_items,query)
|
|
76
77
|
|
|
77
|
-
tokens_len = count_tokens(prompt_str)
|
|
78
|
+
tokens_len = count_tokens(prompt_str)
|
|
78
79
|
|
|
79
80
|
if tokens_len > 55*1024:
|
|
80
81
|
logger.warning(f"Quick filter prompt is too long, tokens_len: {tokens_len}/{55*1024} fallback to normal filter")
|