auto-coder 0.1.240__tar.gz → 0.1.243__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.240 → auto_coder-0.1.243}/PKG-INFO +2 -2
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/auto_coder.egg-info/PKG-INFO +2 -2
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/auto_coder.egg-info/requires.txt +1 -1
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/auto_coder.py +18 -3
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/chat_auto_coder.py +54 -7
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/chat_auto_coder_lang.py +8 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/__init__.py +1 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/auto_coder_lang.py +22 -9
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_merge_editblock.py +2 -2
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_modification_ranker.py +4 -6
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/printer.py +3 -2
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/utils_code_auto_generate.py +7 -4
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/for_command.py +3 -2
- auto_coder-0.1.243/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +381 -0
- auto_coder-0.1.243/src/autocoder/version.py +1 -0
- auto_coder-0.1.240/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +0 -120
- auto_coder-0.1.240/src/autocoder/version.py +0 -1
- {auto_coder-0.1.240 → auto_coder-0.1.243}/LICENSE +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/README.md +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/setup.cfg +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/setup.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/auto_coder.egg-info/SOURCES.txt +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/auto_coder_rag_client_mcp.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/auto_coder_rag_mcp.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_generate.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_generate_diff.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_generate_editblock.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_generate_strict_diff.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/entry.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/filter/quick_filter.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/index.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/tests/test_planner.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.240 → auto_coder-0.1.243}/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.243
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -26,7 +26,7 @@ Requires-Dist: tabulate
|
|
|
26
26
|
Requires-Dist: jupyter_client
|
|
27
27
|
Requires-Dist: prompt-toolkit
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
|
-
Requires-Dist: byzerllm[saas]>=0.1.
|
|
29
|
+
Requires-Dist: byzerllm[saas]>=0.1.159
|
|
30
30
|
Requires-Dist: patch
|
|
31
31
|
Requires-Dist: diff_match_patch
|
|
32
32
|
Requires-Dist: GitPython
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto-coder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.243
|
|
4
4
|
Summary: AutoCoder: AutoCoder
|
|
5
5
|
Author: allwefantasy
|
|
6
6
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -26,7 +26,7 @@ Requires-Dist: tabulate
|
|
|
26
26
|
Requires-Dist: jupyter_client
|
|
27
27
|
Requires-Dist: prompt-toolkit
|
|
28
28
|
Requires-Dist: tokenizers
|
|
29
|
-
Requires-Dist: byzerllm[saas]>=0.1.
|
|
29
|
+
Requires-Dist: byzerllm[saas]>=0.1.159
|
|
30
30
|
Requires-Dist: patch
|
|
31
31
|
Requires-Dist: diff_match_patch
|
|
32
32
|
Requires-Dist: GitPython
|
|
@@ -14,7 +14,7 @@ from autocoder.utils.queue_communicate import (
|
|
|
14
14
|
|
|
15
15
|
import yaml
|
|
16
16
|
import os
|
|
17
|
-
import
|
|
17
|
+
import time
|
|
18
18
|
from byzerllm.utils.client import EventCallbackResult, EventName
|
|
19
19
|
from prompt_toolkit import prompt
|
|
20
20
|
from prompt_toolkit.formatted_text import FormattedText
|
|
@@ -1112,7 +1112,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1112
1112
|
json.dump(chat_history, f, ensure_ascii=False)
|
|
1113
1113
|
console.print(
|
|
1114
1114
|
Panel(
|
|
1115
|
-
"
|
|
1115
|
+
get_message("new_session_started"),
|
|
1116
1116
|
title="Session Status",
|
|
1117
1117
|
expand=False,
|
|
1118
1118
|
border_style="green",
|
|
@@ -1310,6 +1310,9 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1310
1310
|
printer = Printer()
|
|
1311
1311
|
printer.print_in_terminal("memory_save_success")
|
|
1312
1312
|
return {}
|
|
1313
|
+
|
|
1314
|
+
# 计算耗时
|
|
1315
|
+
start_time = time.time()
|
|
1313
1316
|
|
|
1314
1317
|
if "rag" in args.action:
|
|
1315
1318
|
args.enable_rag_search = True
|
|
@@ -1335,12 +1338,23 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1335
1338
|
conversations=loaded_conversations,
|
|
1336
1339
|
llm_config={}
|
|
1337
1340
|
)
|
|
1341
|
+
|
|
1342
|
+
|
|
1338
1343
|
|
|
1339
1344
|
assistant_response, last_meta = stream_out(
|
|
1340
1345
|
v,
|
|
1341
1346
|
request_id=args.request_id,
|
|
1342
1347
|
console=console
|
|
1343
1348
|
)
|
|
1349
|
+
|
|
1350
|
+
# 打印耗时和token统计
|
|
1351
|
+
if last_meta:
|
|
1352
|
+
elapsed_time = time.time() - start_time
|
|
1353
|
+
printer = Printer()
|
|
1354
|
+
printer.print_in_terminal("stream_out_stats",
|
|
1355
|
+
elapsed_time=elapsed_time,
|
|
1356
|
+
input_tokens=last_meta.input_tokens_count,
|
|
1357
|
+
output_tokens=last_meta.generated_tokens_count)
|
|
1344
1358
|
|
|
1345
1359
|
chat_history["ask_conversation"].append(
|
|
1346
1360
|
{"role": "assistant", "content": assistant_response}
|
|
@@ -1361,7 +1375,8 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1361
1375
|
save_to_memory_file(ask_conversation=chat_history["ask_conversation"],
|
|
1362
1376
|
query=args.query,
|
|
1363
1377
|
response=assistant_response)
|
|
1364
|
-
|
|
1378
|
+
printer = Printer()
|
|
1379
|
+
printer.print_in_terminal("memory_save_success")
|
|
1365
1380
|
return
|
|
1366
1381
|
|
|
1367
1382
|
else:
|
|
@@ -1002,6 +1002,51 @@ def load_memory():
|
|
|
1002
1002
|
completer.update_current_files(memory["current_files"]["files"])
|
|
1003
1003
|
|
|
1004
1004
|
|
|
1005
|
+
def print_conf(content:Dict[str,Any]):
|
|
1006
|
+
"""Display configuration dictionary in a Rich table format with enhanced visual styling.
|
|
1007
|
+
|
|
1008
|
+
Args:
|
|
1009
|
+
conf (Dict[str, Any]): Configuration dictionary to display
|
|
1010
|
+
"""
|
|
1011
|
+
console = Console()
|
|
1012
|
+
|
|
1013
|
+
# Create a styled table with rounded borders
|
|
1014
|
+
table = Table(
|
|
1015
|
+
show_header=True,
|
|
1016
|
+
header_style="bold magenta",
|
|
1017
|
+
title=get_message("conf_title"),
|
|
1018
|
+
title_style="bold blue",
|
|
1019
|
+
border_style="blue",
|
|
1020
|
+
show_lines=True
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
# Add columns with explicit width and alignment
|
|
1024
|
+
table.add_column(get_message("conf_key"), style="cyan", justify="right", width=30, no_wrap=False)
|
|
1025
|
+
table.add_column(get_message("conf_value"), style="green", justify="left", width=50, no_wrap=False)
|
|
1026
|
+
|
|
1027
|
+
# Sort keys for consistent display
|
|
1028
|
+
for key in sorted(content.keys()):
|
|
1029
|
+
value = content[key]
|
|
1030
|
+
# Format value based on type
|
|
1031
|
+
if isinstance(value, (dict, list)):
|
|
1032
|
+
formatted_value = Text(json.dumps(value, indent=2), style="yellow")
|
|
1033
|
+
elif isinstance(value, bool):
|
|
1034
|
+
formatted_value = Text(str(value), style="bright_green" if value else "red")
|
|
1035
|
+
elif isinstance(value, (int, float)):
|
|
1036
|
+
formatted_value = Text(str(value), style="bright_cyan")
|
|
1037
|
+
else:
|
|
1038
|
+
formatted_value = Text(str(value), style="green")
|
|
1039
|
+
|
|
1040
|
+
table.add_row(str(key), formatted_value)
|
|
1041
|
+
|
|
1042
|
+
# Add padding and print with a panel
|
|
1043
|
+
console.print(Panel(
|
|
1044
|
+
table,
|
|
1045
|
+
padding=(1, 2),
|
|
1046
|
+
subtitle=f"[italic]{get_message('conf_subtitle')}[/italic]",
|
|
1047
|
+
border_style="blue"
|
|
1048
|
+
))
|
|
1049
|
+
|
|
1005
1050
|
def revert():
|
|
1006
1051
|
last_yaml_file = get_last_yaml_file("actions")
|
|
1007
1052
|
if last_yaml_file:
|
|
@@ -2123,6 +2168,11 @@ def manage_models(params, query: str):
|
|
|
2123
2168
|
if "/add" in query:
|
|
2124
2169
|
subcmd = "/add"
|
|
2125
2170
|
query = query.replace("/add", "", 1).strip()
|
|
2171
|
+
|
|
2172
|
+
# alias to /add
|
|
2173
|
+
if "/activate" in query:
|
|
2174
|
+
subcmd = "/add"
|
|
2175
|
+
query = query.replace("/activate", "", 1).strip()
|
|
2126
2176
|
|
|
2127
2177
|
if "/remove" in query:
|
|
2128
2178
|
subcmd = "/remove"
|
|
@@ -2141,7 +2191,7 @@ def manage_models(params, query: str):
|
|
|
2141
2191
|
)
|
|
2142
2192
|
table.add_column("Name", style="cyan", width=40, no_wrap=False)
|
|
2143
2193
|
table.add_column("Model Name", style="magenta", width=30, overflow="fold")
|
|
2144
|
-
table.add_column("
|
|
2194
|
+
table.add_column("Base URL", style="white", width=50, overflow="fold")
|
|
2145
2195
|
for m in models_data:
|
|
2146
2196
|
# Check if api_key_path exists and file exists
|
|
2147
2197
|
api_key_path = m.get("api_key_path", "")
|
|
@@ -2154,7 +2204,7 @@ def manage_models(params, query: str):
|
|
|
2154
2204
|
table.add_row(
|
|
2155
2205
|
name,
|
|
2156
2206
|
m.get("model_name", ""),
|
|
2157
|
-
m.get("
|
|
2207
|
+
m.get("base_url", "")
|
|
2158
2208
|
)
|
|
2159
2209
|
console.print(table)
|
|
2160
2210
|
else:
|
|
@@ -2366,10 +2416,7 @@ def execute_shell_command(command: str):
|
|
|
2366
2416
|
if process.returncode != 0:
|
|
2367
2417
|
console.print(
|
|
2368
2418
|
f"[bold red]Command failed with return code {process.returncode}[/bold red]"
|
|
2369
|
-
)
|
|
2370
|
-
else:
|
|
2371
|
-
console.print(
|
|
2372
|
-
"[bold green]Command completed successfully[/bold green]")
|
|
2419
|
+
)
|
|
2373
2420
|
|
|
2374
2421
|
except FileNotFoundError:
|
|
2375
2422
|
console.print(
|
|
@@ -2705,7 +2752,7 @@ def main():
|
|
|
2705
2752
|
elif user_input.startswith("/conf"):
|
|
2706
2753
|
conf = user_input[len("/conf"):].strip()
|
|
2707
2754
|
if not conf:
|
|
2708
|
-
|
|
2755
|
+
print_conf(memory["conf"])
|
|
2709
2756
|
else:
|
|
2710
2757
|
configure(conf)
|
|
2711
2758
|
elif user_input.startswith("/revert"):
|
|
@@ -75,6 +75,10 @@ MESSAGES = {
|
|
|
75
75
|
"shell_desc": "Execute a shell command",
|
|
76
76
|
"voice_input_desc": "Convert voice input to text",
|
|
77
77
|
"mode_desc": "Switch input mode",
|
|
78
|
+
"conf_key": "Key",
|
|
79
|
+
"conf_value": "Value",
|
|
80
|
+
"conf_title": "Configuration Settings",
|
|
81
|
+
"conf_subtitle": "Use /conf <key>:<value> to modify these settings",
|
|
78
82
|
"lib_desc": "Manage libraries",
|
|
79
83
|
"exit_desc": "Exit the program",
|
|
80
84
|
"design_desc": "Generate SVG image based on the provided description",
|
|
@@ -187,6 +191,10 @@ MESSAGES = {
|
|
|
187
191
|
"design_desc": "根据需求设计SVG图片",
|
|
188
192
|
"commit_desc": "根据用户人工修改的代码自动生成yaml文件并提交更改",
|
|
189
193
|
"models_desc": "管理模型配置,仅在lite模式下可用",
|
|
194
|
+
"conf_key": "键",
|
|
195
|
+
"conf_value": "值",
|
|
196
|
+
"conf_title": "配置设置",
|
|
197
|
+
"conf_subtitle": "使用 /conf <key>:<value> 修改这些设置",
|
|
190
198
|
"models_usage": "用法: /models /list|/add|/add_model|/remove ...",
|
|
191
199
|
"models_added": "成功添加/更新模型 '{{name}}'。",
|
|
192
200
|
"models_add_failed": "添加模型 '{{name}}' 失败。在默认模型中未找到该模型。",
|
|
@@ -350,6 +350,7 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
350
350
|
skip_events: Optional[bool] = False
|
|
351
351
|
data_cells_max_num: Optional[int] = 2000
|
|
352
352
|
generate_times_same_model: Optional[int] = 1
|
|
353
|
+
rank_times_same_model: Optional[int] = 1
|
|
353
354
|
|
|
354
355
|
action: List[str] = []
|
|
355
356
|
enable_global_memory: Optional[bool] = True
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import locale
|
|
2
2
|
|
|
3
3
|
MESSAGES = {
|
|
4
|
-
|
|
4
|
+
"en": {
|
|
5
|
+
"new_session_started": "New session started. Previous chat history has been archived.",
|
|
5
6
|
"memory_save_success": "✅ Saved to your memory",
|
|
6
7
|
"index_file_too_large": "⚠️ File {{ file_path }} is too large ({{ file_size }} > {{ max_length }}), splitting into chunks...",
|
|
7
8
|
"index_update_success": "✅ Successfully updated index for {{ file_path }} (md5: {{ md5 }}) in {{ duration }}s",
|
|
@@ -60,9 +61,19 @@ MESSAGES = {
|
|
|
60
61
|
"ranking_all_failed": "All ranking requests failed",
|
|
61
62
|
"ranking_complete": "Ranking completed in {{ elapsed }}s, total voters: {{ total_tasks }}, best candidate index: {{ best_candidate }}, scores: {{ scores }}, input_tokens: {{ input_tokens }}, output_tokens: {{ output_tokens }}",
|
|
62
63
|
"ranking_process_failed": "Ranking process failed: {{ error }}",
|
|
63
|
-
"ranking_failed": "Ranking failed in {{ elapsed }}s, using original order"
|
|
64
|
+
"ranking_failed": "Ranking failed in {{ elapsed }}s, using original order",
|
|
65
|
+
"begin_index_source_code": "🚀 Begin to index source code in {{ source_dir }}",
|
|
66
|
+
"stream_out_stats": "Elapsed time {{ elapsed_time }} seconds, input tokens: {{ input_tokens }}, output tokens: {{ output_tokens }}",
|
|
67
|
+
"upsert_file": "✅ Updated file: {{ file_path }}",
|
|
68
|
+
"unmerged_blocks_title": "Unmerged Blocks",
|
|
69
|
+
"unmerged_file_path": "File: {{file_path}}",
|
|
70
|
+
"unmerged_search_block": "Search Block({{similarity}}):",
|
|
71
|
+
"unmerged_replace_block": "Replace Block:",
|
|
72
|
+
"unmerged_blocks_total": "Total unmerged blocks: {{num_blocks}}",
|
|
73
|
+
"git_init_required": "⚠️ auto_merge only applies to git repositories.\n\nPlease try using git init in the source directory:\n\n```shell\ncd {{ source_dir }}\ngit init.\n```\n\nThen run auto - coder again.\nError: {{ error }}"
|
|
64
74
|
},
|
|
65
75
|
"zh": {
|
|
76
|
+
"new_session_started": "新会话已开始。之前的聊天历史已存档。",
|
|
66
77
|
"memory_save_success": "✅ 已保存到您的记忆中",
|
|
67
78
|
"index_file_too_large": "⚠️ 文件 {{ file_path }} 过大 ({{ file_size }} > {{ max_length }}), 正在分块处理...",
|
|
68
79
|
"index_update_success": "✅ 成功更新 {{ file_path }} 的索引 (md5: {{ md5 }}), 耗时 {{ duration }} 秒",
|
|
@@ -108,16 +119,17 @@ MESSAGES = {
|
|
|
108
119
|
"normal_filter_start": "开始查找上下文(normal_filter)...",
|
|
109
120
|
"pylint_check_failed": "⚠️ Pylint 检查失败: {{ error_message }}",
|
|
110
121
|
"pylint_error": "❌ 运行 Pylint 时出错: {{ error_message }}",
|
|
122
|
+
"begin_index_source_code": "🚀 开始为 {{ source_dir }} 中的源代码建立索引",
|
|
111
123
|
"unmerged_blocks_warning": "⚠️ 发现 {{ num_blocks }} 个未合并的代码块,更改将不会被应用。请手动检查后重试。",
|
|
112
124
|
"pylint_file_check_failed": "⚠️ {{ file_path }} 的 Pylint 检查失败。更改未应用。错误: {{ error_message }}",
|
|
113
125
|
"merge_success": "✅ 成功合并了 {{ num_files }} 个文件中的更改 {{ num_changes }}/{{ total_blocks }} 个代码块。",
|
|
114
126
|
"no_changes_made": "⚠️ 未对任何文件进行更改。",
|
|
115
|
-
"unmerged_blocks_title": "
|
|
116
|
-
"unmerged_file_path": "
|
|
117
|
-
"unmerged_search_block": "Search Block({similarity}):",
|
|
127
|
+
"unmerged_blocks_title": "未合并代码块",
|
|
128
|
+
"unmerged_file_path": "文件: {file_path}",
|
|
129
|
+
"unmerged_search_block": "Search Block({{similarity}}):",
|
|
118
130
|
"unmerged_replace_block": "Replace Block:",
|
|
119
|
-
"unmerged_blocks_total": "
|
|
120
|
-
"git_init_required": "⚠️ auto_merge 仅适用于 git 仓库。\n\n请尝试在源目录中使用 git init:\n\n```shell\ncd {{ source_dir }}\ngit init
|
|
131
|
+
"unmerged_blocks_total": "未合并代码块数量: {{num_blocks}}",
|
|
132
|
+
"git_init_required": "⚠️ auto_merge 仅适用于 git 仓库。\n\n请尝试在源目录中使用 git init:\n\n```shell\ncd {{ source_dir }}\ngit init.\n```\n\n然后再次运行 auto-coder。\n错误: {{ error }}",
|
|
121
133
|
"upsert_file": "✅ 更新文件: {{ file_path }}",
|
|
122
134
|
"files_merged": "✅ 成功合并了 {{ total }} 个文件到项目中。",
|
|
123
135
|
"merge_failed": "❌ 合并文件 {{ path }} 失败: {{ error }}",
|
|
@@ -128,8 +140,9 @@ MESSAGES = {
|
|
|
128
140
|
"ranking_all_failed": "所有排序请求都失败",
|
|
129
141
|
"ranking_complete": "排序完成,耗时 {{ elapsed }} 秒,总投票数: {{ total_tasks }},最佳候选索引: {{ best_candidate }},得分: {{ scores }},输入token数: {{ input_tokens }},输出token数: {{ output_tokens }}",
|
|
130
142
|
"ranking_process_failed": "排序过程失败: {{ error }}",
|
|
131
|
-
"ranking_failed": "排序失败,耗时 {{ elapsed }} 秒,使用原始顺序"
|
|
132
|
-
|
|
143
|
+
"ranking_failed": "排序失败,耗时 {{ elapsed }} 秒,使用原始顺序",
|
|
144
|
+
"stream_out_stats": "耗时 {{ elapsed_time }} 秒,输入token数: {{ input_tokens }}, 输出token数: {{ output_tokens }}"
|
|
145
|
+
},
|
|
133
146
|
}
|
|
134
147
|
|
|
135
148
|
|
|
@@ -422,11 +422,11 @@ class CodeAutoMergeEditBlock:
|
|
|
422
422
|
self.printer.print_in_terminal("unmerged_blocks_title", style="bold red")
|
|
423
423
|
for file_path, head, update, similarity in unmerged_blocks:
|
|
424
424
|
self.printer.print_str_in_terminal(
|
|
425
|
-
f"\n{self.printer.
|
|
425
|
+
f"\n{self.printer.get_message_from_key_with_format('unmerged_file_path',file_path=file_path)}",
|
|
426
426
|
style="bold blue"
|
|
427
427
|
)
|
|
428
428
|
self.printer.print_str_in_terminal(
|
|
429
|
-
f"\n{self.printer.
|
|
429
|
+
f"\n{self.printer.get_message_from_key_with_format('unmerged_search_block',similarity=similarity)}",
|
|
430
430
|
style="bold green"
|
|
431
431
|
)
|
|
432
432
|
syntax = Syntax(head, "python", theme="monokai", line_numbers=True)
|
|
@@ -66,8 +66,8 @@ class CodeModificationRanker:
|
|
|
66
66
|
|
|
67
67
|
self.printer.print_in_terminal(
|
|
68
68
|
"ranking_start", style="blue", count=len(generate_result.contents))
|
|
69
|
-
|
|
70
|
-
total_tasks = len(self.llms) *
|
|
69
|
+
rank_times = self.args.rank_times_same_model
|
|
70
|
+
total_tasks = len(self.llms) * rank_times
|
|
71
71
|
|
|
72
72
|
query = self._rank_modifications.prompt(generate_result)
|
|
73
73
|
input_tokens_count = 0
|
|
@@ -78,7 +78,7 @@ class CodeModificationRanker:
|
|
|
78
78
|
# Submit tasks for each model and generate_times
|
|
79
79
|
futures = []
|
|
80
80
|
for llm in self.llms:
|
|
81
|
-
for _ in range(
|
|
81
|
+
for _ in range(rank_times):
|
|
82
82
|
futures.append(
|
|
83
83
|
executor.submit(
|
|
84
84
|
chat_with_continue,
|
|
@@ -99,9 +99,7 @@ class CodeModificationRanker:
|
|
|
99
99
|
results.append(v.rank_result)
|
|
100
100
|
except Exception as e:
|
|
101
101
|
self.printer.print_in_terminal(
|
|
102
|
-
"ranking_failed_request", style="yellow", error=str(e))
|
|
103
|
-
if self.args.debug:
|
|
104
|
-
print(traceback.format_exc())
|
|
102
|
+
"ranking_failed_request", style="yellow", error=str(e))
|
|
105
103
|
continue
|
|
106
104
|
|
|
107
105
|
if not results:
|
|
@@ -5,6 +5,7 @@ from typing import Optional,Dict,Any
|
|
|
5
5
|
from byzerllm.utils import format_str_jinja2
|
|
6
6
|
from autocoder.common.auto_coder_lang import get_message
|
|
7
7
|
from autocoder.chat_auto_coder_lang import get_message as get_chat_message
|
|
8
|
+
|
|
8
9
|
class Printer:
|
|
9
10
|
def __init__(self,console:Optional[Console]=None):
|
|
10
11
|
if console is None:
|
|
@@ -45,5 +46,5 @@ class Printer:
|
|
|
45
46
|
|
|
46
47
|
def print_panel(self, content: str, text_options:Dict[str,Any], panel_options:Dict[str,Any]):
|
|
47
48
|
panel = Panel(Text(content, **text_options), **panel_options)
|
|
48
|
-
self.console.print(panel)
|
|
49
|
-
|
|
49
|
+
self.console.print(panel)
|
|
50
|
+
|
|
@@ -57,7 +57,7 @@ def stream_chat_with_continue(
|
|
|
57
57
|
count = 0
|
|
58
58
|
temp_conversations = conversations
|
|
59
59
|
current_metadata = None
|
|
60
|
-
|
|
60
|
+
metadatas = {}
|
|
61
61
|
while True:
|
|
62
62
|
# 使用流式接口获取生成内容
|
|
63
63
|
stream_generator = llm.stream_chat_oai(
|
|
@@ -67,17 +67,20 @@ def stream_chat_with_continue(
|
|
|
67
67
|
)
|
|
68
68
|
|
|
69
69
|
current_content = ""
|
|
70
|
+
|
|
70
71
|
for res in stream_generator:
|
|
71
72
|
content = res[0]
|
|
72
73
|
current_content += content
|
|
73
74
|
if current_metadata is None:
|
|
74
75
|
current_metadata = res[1]
|
|
75
76
|
else:
|
|
76
|
-
|
|
77
|
-
current_metadata.
|
|
78
|
-
current_metadata.
|
|
77
|
+
metadatas[count] = res[1]
|
|
78
|
+
current_metadata.finish_reason = res[1].finish_reason
|
|
79
|
+
current_metadata.reasoning_content = res[1].reasoning_content
|
|
79
80
|
|
|
80
81
|
# Yield 当前的 StreamChatWithContinueResult
|
|
82
|
+
current_metadata.generated_tokens_count = sum([v.generated_tokens_count for _, v in metadatas.items()])
|
|
83
|
+
current_metadata.input_tokens_count = sum([v.input_tokens_count for _, v in metadatas.items()])
|
|
81
84
|
yield (content,current_metadata)
|
|
82
85
|
|
|
83
86
|
# 更新对话历史
|
|
@@ -5,7 +5,7 @@ from autocoder.tsproject import TSProject
|
|
|
5
5
|
from autocoder.pyproject import PyProject
|
|
6
6
|
import tabulate
|
|
7
7
|
import textwrap
|
|
8
|
-
from
|
|
8
|
+
from autocoder.common.printer import Printer
|
|
9
9
|
import os
|
|
10
10
|
from autocoder.utils.request_queue import (
|
|
11
11
|
request_queue,
|
|
@@ -35,7 +35,8 @@ def wrap_text_in_table(data, max_width=60):
|
|
|
35
35
|
def index_command(args, llm):
|
|
36
36
|
source_dir = os.path.abspath(args.source_dir)
|
|
37
37
|
args.source_dir = source_dir
|
|
38
|
-
|
|
38
|
+
printer = Printer()
|
|
39
|
+
printer.print_in_terminal("begin_index_source_code", style="bold green", source_dir=source_dir)
|
|
39
40
|
if args.project_type == "ts":
|
|
40
41
|
pp = TSProject(args=args, llm=llm)
|
|
41
42
|
elif args.project_type == "py":
|