auto-coder 0.1.249__tar.gz → 0.1.251__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.249 → auto_coder-0.1.251}/PKG-INFO +1 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/auto_coder.egg-info/PKG-INFO +1 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/auto_review_commit.py +0 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/auto_coder.py +10 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/chat_auto_coder.py +2 -2
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/__init__.py +2 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/auto_coder_lang.py +5 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate.py +10 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_diff.py +10 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_editblock.py +22 -8
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_strict_diff.py +10 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/command_generator.py +2 -2
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/printer.py +4 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/filter/quick_filter.py +4 -2
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/index.py +5 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +28 -7
- auto_coder-0.1.251/src/autocoder/version.py +1 -0
- auto_coder-0.1.249/src/autocoder/version.py +0 -1
- {auto_coder-0.1.249 → auto_coder-0.1.251}/LICENSE +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/README.md +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/setup.cfg +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/setup.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/auto_coder.egg-info/SOURCES.txt +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/auto_coder_rag_client_mcp.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/auto_coder_rag_mcp.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/shells.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/utils_code_auto_generate.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/entry.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/tests/test_planner.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.249 → auto_coder-0.1.251}/tests/test_symbols_utils.py +0 -0
|
@@ -5,7 +5,6 @@ import byzerllm
|
|
|
5
5
|
import pydantic
|
|
6
6
|
import git
|
|
7
7
|
from rich.console import Console
|
|
8
|
-
from autocoder.utils.auto_coder_utils.chat_stream_out import stream_out
|
|
9
8
|
from autocoder.common.printer import Printer
|
|
10
9
|
from autocoder.common import AutoCoderArgs
|
|
11
10
|
from autocoder.common.utils_code_auto_generate import stream_chat_with_continue
|
|
@@ -45,6 +45,7 @@ from autocoder import models as models_module
|
|
|
45
45
|
from autocoder.common.utils_code_auto_generate import stream_chat_with_continue
|
|
46
46
|
from autocoder.utils.auto_coder_utils.chat_stream_out import stream_out
|
|
47
47
|
from autocoder.common.printer import Printer
|
|
48
|
+
from autocoder.rag.token_counter import count_tokens
|
|
48
49
|
console = Console()
|
|
49
50
|
|
|
50
51
|
|
|
@@ -1333,6 +1334,13 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1333
1334
|
reviewer = AutoReviewCommit(llm=chat_llm, args=args)
|
|
1334
1335
|
v = reviewer.review_commit(query=args.query,conversations=loaded_conversations)
|
|
1335
1336
|
else:
|
|
1337
|
+
# 预估token数量
|
|
1338
|
+
estimated_input_tokens = count_tokens(json.dumps(loaded_conversations, ensure_ascii=False))
|
|
1339
|
+
printer = Printer()
|
|
1340
|
+
printer.print_in_terminal("estimated_chat_input_tokens", style="yellow",
|
|
1341
|
+
estimated_input_tokens=estimated_input_tokens
|
|
1342
|
+
)
|
|
1343
|
+
|
|
1336
1344
|
v = stream_chat_with_continue(
|
|
1337
1345
|
llm=chat_llm,
|
|
1338
1346
|
conversations=loaded_conversations,
|
|
@@ -1348,7 +1356,8 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
1348
1356
|
v,
|
|
1349
1357
|
request_id=args.request_id,
|
|
1350
1358
|
console=console,
|
|
1351
|
-
model_name=model_name
|
|
1359
|
+
model_name=model_name,
|
|
1360
|
+
args=args
|
|
1352
1361
|
)
|
|
1353
1362
|
|
|
1354
1363
|
# 打印耗时和token统计
|
|
@@ -2796,8 +2796,8 @@ def main():
|
|
|
2796
2796
|
command = user_input[len("/shell"):].strip()
|
|
2797
2797
|
if not command:
|
|
2798
2798
|
print("Please enter a shell command to execute.")
|
|
2799
|
-
|
|
2800
|
-
|
|
2799
|
+
else:
|
|
2800
|
+
execute_shell_command(command)
|
|
2801
2801
|
|
|
2802
2802
|
except KeyboardInterrupt:
|
|
2803
2803
|
continue
|
|
@@ -86,7 +86,9 @@ MESSAGES = {
|
|
|
86
86
|
"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 }}",
|
|
87
87
|
"quick_filter_reason": "Auto get(quick_filter mode)",
|
|
88
88
|
"quick_filter_too_long": "⚠️ index file is too large ({{ tokens_len }}/{{ max_tokens }}). The query will be split into {{ split_size }} chunks.",
|
|
89
|
-
"quick_filter_tokens_len": "📊 Current index size: {{ tokens_len }} tokens"
|
|
89
|
+
"quick_filter_tokens_len": "📊 Current index size: {{ tokens_len }} tokens",
|
|
90
|
+
"estimated_chat_input_tokens": "Estimated chat input tokens: {{ estimated_input_tokens }}",
|
|
91
|
+
"estimated_input_tokens_in_generate": "Estimated input tokens in generate ({{ generate_mode }}): {{ estimated_input_tokens }}",
|
|
90
92
|
},
|
|
91
93
|
"zh": {
|
|
92
94
|
"model_not_found": "未找到模型: {{model_name}}",
|
|
@@ -173,6 +175,8 @@ MESSAGES = {
|
|
|
173
175
|
"quick_filter_stats": "Quick filter completed in {{ elapsed_time }} seconds, input tokens: {{ input_tokens }}, output tokens: {{ output_tokens }}",
|
|
174
176
|
"quick_filter_title": "{{ model_name }} 正在分析如何筛选上下文...",
|
|
175
177
|
"quick_filter_failed": "❌ 快速过滤器失败: {{ error }}. ",
|
|
178
|
+
"estimated_chat_input_tokens": "对话输入token预估为: {{ estimated_input_tokens }}",
|
|
179
|
+
"estimated_input_tokens_in_generate": "生成代码({{ generate_mode }})预计输入token数: {{ estimated_input_tokens_in_generate }}",
|
|
176
180
|
},
|
|
177
181
|
}
|
|
178
182
|
|
|
@@ -8,6 +8,8 @@ from concurrent.futures import ThreadPoolExecutor
|
|
|
8
8
|
from autocoder.common.types import CodeGenerateResult
|
|
9
9
|
from autocoder.common.utils_code_auto_generate import chat_with_continue
|
|
10
10
|
import json
|
|
11
|
+
from autocoder.common.printer import Printer
|
|
12
|
+
from autocoder.rag.token_counter import count_tokens
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
class CodeAutoGenerate:
|
|
@@ -191,6 +193,14 @@ class CodeAutoGenerate:
|
|
|
191
193
|
results = []
|
|
192
194
|
input_tokens_count = 0
|
|
193
195
|
generated_tokens_count = 0
|
|
196
|
+
|
|
197
|
+
printer = Printer()
|
|
198
|
+
estimated_input_tokens = count_tokens(json.dumps(conversations, ensure_ascii=False))
|
|
199
|
+
printer.print_in_terminal("estimated_input_tokens_in_generate", style="yellow",
|
|
200
|
+
estimated_input_tokens_in_generate=estimated_input_tokens,
|
|
201
|
+
generate_mode="wholefile"
|
|
202
|
+
)
|
|
203
|
+
|
|
194
204
|
if not self.args.human_as_model:
|
|
195
205
|
with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
|
|
196
206
|
futures = []
|
|
@@ -7,6 +7,8 @@ from autocoder.common import sys_prompt
|
|
|
7
7
|
from concurrent.futures import ThreadPoolExecutor
|
|
8
8
|
import json
|
|
9
9
|
from autocoder.common.utils_code_auto_generate import chat_with_continue
|
|
10
|
+
from autocoder.common.printer import Printer
|
|
11
|
+
from autocoder.rag.token_counter import count_tokens
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class CodeAutoGenerateDiff:
|
|
@@ -339,6 +341,14 @@ class CodeAutoGenerateDiff:
|
|
|
339
341
|
results = []
|
|
340
342
|
input_tokens_count = 0
|
|
341
343
|
generated_tokens_count = 0
|
|
344
|
+
|
|
345
|
+
printer = Printer()
|
|
346
|
+
estimated_input_tokens = count_tokens(json.dumps(conversations, ensure_ascii=False))
|
|
347
|
+
printer.print_in_terminal("estimated_input_tokens_in_generate", style="yellow",
|
|
348
|
+
estimated_input_tokens_in_generate=estimated_input_tokens,
|
|
349
|
+
generate_mode="diff"
|
|
350
|
+
)
|
|
351
|
+
|
|
342
352
|
if not self.args.human_as_model:
|
|
343
353
|
with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
|
|
344
354
|
futures = []
|
{auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_editblock.py
RENAMED
|
@@ -11,6 +11,8 @@ from autocoder.utils.queue_communicate import (
|
|
|
11
11
|
import json
|
|
12
12
|
from concurrent.futures import ThreadPoolExecutor
|
|
13
13
|
from autocoder.common.utils_code_auto_generate import chat_with_continue
|
|
14
|
+
from autocoder.common.printer import Printer
|
|
15
|
+
from autocoder.rag.token_counter import count_tokens
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
class CodeAutoGenerateEditBlock:
|
|
@@ -421,35 +423,47 @@ class CodeAutoGenerateEditBlock:
|
|
|
421
423
|
results = []
|
|
422
424
|
input_tokens_count = 0
|
|
423
425
|
generated_tokens_count = 0
|
|
426
|
+
|
|
427
|
+
printer = Printer()
|
|
428
|
+
estimated_input_tokens = count_tokens(
|
|
429
|
+
json.dumps(conversations, ensure_ascii=False))
|
|
430
|
+
printer.print_in_terminal("estimated_input_tokens_in_generate",
|
|
431
|
+
style="yellow",
|
|
432
|
+
estimated_input_tokens_in_generate=estimated_input_tokens,
|
|
433
|
+
generate_mode="editblock"
|
|
434
|
+
)
|
|
435
|
+
|
|
424
436
|
if not self.args.human_as_model:
|
|
425
437
|
with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
|
|
426
438
|
futures = []
|
|
427
439
|
for llm in self.llms:
|
|
428
440
|
for _ in range(self.generate_times_same_model):
|
|
429
441
|
futures.append(executor.submit(
|
|
430
|
-
chat_with_continue,llm=llm, conversations=conversations, llm_config=llm_config))
|
|
442
|
+
chat_with_continue, llm=llm, conversations=conversations, llm_config=llm_config))
|
|
431
443
|
temp_results = [future.result() for future in futures]
|
|
432
444
|
for result in temp_results:
|
|
433
445
|
results.append(result.content)
|
|
434
446
|
input_tokens_count += result.input_tokens_count
|
|
435
447
|
generated_tokens_count += result.generated_tokens_count
|
|
436
|
-
|
|
448
|
+
|
|
437
449
|
for result in results:
|
|
438
450
|
conversations_list.append(
|
|
439
451
|
conversations + [{"role": "assistant", "content": result}])
|
|
440
|
-
else:
|
|
452
|
+
else:
|
|
441
453
|
for _ in range(self.args.human_model_num):
|
|
442
|
-
single_result = chat_with_continue(
|
|
454
|
+
single_result = chat_with_continue(
|
|
455
|
+
llm=self.llms[0], conversations=conversations, llm_config=llm_config)
|
|
443
456
|
results.append(single_result.content)
|
|
444
457
|
input_tokens_count += single_result.input_tokens_count
|
|
445
458
|
generated_tokens_count += single_result.generated_tokens_count
|
|
446
|
-
conversations_list.append(
|
|
447
|
-
|
|
459
|
+
conversations_list.append(
|
|
460
|
+
conversations + [{"role": "assistant", "content": single_result.content}])
|
|
461
|
+
|
|
448
462
|
statistics = {
|
|
449
463
|
"input_tokens_count": input_tokens_count,
|
|
450
464
|
"generated_tokens_count": generated_tokens_count
|
|
451
|
-
}
|
|
452
|
-
|
|
465
|
+
}
|
|
466
|
+
|
|
453
467
|
if self.args.request_id and not self.args.skip_events:
|
|
454
468
|
_ = queue_communicate.send_event(
|
|
455
469
|
request_id=self.args.request_id,
|
{auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_strict_diff.py
RENAMED
|
@@ -7,6 +7,8 @@ from autocoder.common import sys_prompt
|
|
|
7
7
|
from concurrent.futures import ThreadPoolExecutor
|
|
8
8
|
import json
|
|
9
9
|
from autocoder.common.utils_code_auto_generate import chat_with_continue
|
|
10
|
+
from autocoder.common.printer import Printer
|
|
11
|
+
from autocoder.rag.token_counter import count_tokens
|
|
10
12
|
|
|
11
13
|
class CodeAutoGenerateStrictDiff:
|
|
12
14
|
def __init__(
|
|
@@ -309,6 +311,14 @@ class CodeAutoGenerateStrictDiff:
|
|
|
309
311
|
results = []
|
|
310
312
|
input_tokens_count = 0
|
|
311
313
|
generated_tokens_count = 0
|
|
314
|
+
|
|
315
|
+
printer = Printer()
|
|
316
|
+
estimated_input_tokens = count_tokens(json.dumps(conversations, ensure_ascii=False))
|
|
317
|
+
printer.print_in_terminal("estimated_input_tokens_in_generate", style="yellow",
|
|
318
|
+
estimated_input_tokens_in_generate=estimated_input_tokens,
|
|
319
|
+
generate_mode="strict_diff"
|
|
320
|
+
)
|
|
321
|
+
|
|
312
322
|
if not self.args.human_as_model:
|
|
313
323
|
with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
|
|
314
324
|
futures = []
|
|
@@ -54,9 +54,9 @@ def generate_shell_script(user_input: str, llm: byzerllm.ByzerLLM) -> str:
|
|
|
54
54
|
result, _ = stream_out(
|
|
55
55
|
llm.stream_chat_oai(conversations=conversations, delta_mode=True),
|
|
56
56
|
model_name=llm.default_model_name,
|
|
57
|
-
title=title
|
|
57
|
+
title=title
|
|
58
58
|
)
|
|
59
59
|
|
|
60
60
|
# 提取代码块
|
|
61
|
-
code = code_utils.extract_code(result)[
|
|
61
|
+
code = code_utils.extract_code(result)[-1][1]
|
|
62
62
|
return code
|
|
@@ -32,7 +32,10 @@ class Printer:
|
|
|
32
32
|
else:
|
|
33
33
|
self.console.print(format_str_jinja2(self.get_message_from_key(msg_key),**kwargs))
|
|
34
34
|
except Exception as e:
|
|
35
|
-
|
|
35
|
+
try:
|
|
36
|
+
print(self.get_message_from_key(msg_key))
|
|
37
|
+
except Exception as e:
|
|
38
|
+
print(f"text key: {msg_key} not found")
|
|
36
39
|
|
|
37
40
|
|
|
38
41
|
def print_str_in_terminal(self, content: str, style: str = None):
|
|
@@ -84,7 +84,8 @@ class QuickFilter():
|
|
|
84
84
|
full_response, _ = stream_out(
|
|
85
85
|
stream_generator,
|
|
86
86
|
model_name=model_name,
|
|
87
|
-
title=self.printer.get_message_from_key_with_format("quick_filter_title", model_name=model_name)
|
|
87
|
+
title=self.printer.get_message_from_key_with_format("quick_filter_title", model_name=model_name),
|
|
88
|
+
args=self.args
|
|
88
89
|
)
|
|
89
90
|
file_number_list = to_model(full_response, FileNumberList)
|
|
90
91
|
else:
|
|
@@ -197,7 +198,8 @@ class QuickFilter():
|
|
|
197
198
|
full_response, last_meta = stream_out(
|
|
198
199
|
stream_generator,
|
|
199
200
|
model_name=model_name,
|
|
200
|
-
title=self.printer.get_message_from_key_with_format("quick_filter_title", model_name=model_name)
|
|
201
|
+
title=self.printer.get_message_from_key_with_format("quick_filter_title", model_name=model_name),
|
|
202
|
+
args=self.args
|
|
201
203
|
)
|
|
202
204
|
# 解析结果
|
|
203
205
|
file_number_list = to_model(full_response, FileNumberList)
|
|
@@ -341,7 +341,11 @@ class IndexManager:
|
|
|
341
341
|
module_name = result["module_name"]
|
|
342
342
|
index_data[module_name] = result
|
|
343
343
|
updated_sources.append(module_name)
|
|
344
|
-
|
|
344
|
+
if len(updated_sources) > 5:
|
|
345
|
+
with open(self.index_file, "w") as file:
|
|
346
|
+
json.dump(index_data, file, ensure_ascii=False, indent=2)
|
|
347
|
+
updated_sources = []
|
|
348
|
+
|
|
345
349
|
# 如果 updated_sources 或 keys_to_remove 有值,则保存索引文件
|
|
346
350
|
if updated_sources or keys_to_remove:
|
|
347
351
|
with open(self.index_file, "w") as file:
|
{auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py
RENAMED
|
@@ -10,6 +10,7 @@ from autocoder.utils.request_queue import RequestValue, RequestOption, StreamVal
|
|
|
10
10
|
from autocoder.utils.request_queue import request_queue
|
|
11
11
|
import time
|
|
12
12
|
from byzerllm.utils.types import SingleOutputMeta
|
|
13
|
+
from autocoder.common import AutoCoderArgs
|
|
13
14
|
|
|
14
15
|
MAX_HISTORY_LINES = 40 # 最大保留历史行数
|
|
15
16
|
|
|
@@ -144,7 +145,8 @@ def stream_out(
|
|
|
144
145
|
request_id: Optional[str] = None,
|
|
145
146
|
console: Optional[Console] = None,
|
|
146
147
|
model_name: Optional[str] = None,
|
|
147
|
-
title: Optional[str] = None
|
|
148
|
+
title: Optional[str] = None,
|
|
149
|
+
args: Optional[AutoCoderArgs] = None
|
|
148
150
|
) -> Tuple[str, Optional[SingleOutputMeta]]:
|
|
149
151
|
"""
|
|
150
152
|
处理流式输出事件并在终端中展示
|
|
@@ -155,17 +157,22 @@ def stream_out(
|
|
|
155
157
|
console: Rich Console对象
|
|
156
158
|
model_name: 模型名称
|
|
157
159
|
title: 面板标题,如果没有提供则使用默认值
|
|
160
|
+
args: AutoCoderArgs对象
|
|
158
161
|
Returns:
|
|
159
|
-
Tuple[str, Dict[
|
|
162
|
+
Tuple[str, Dict[SingleOutputMeta]]: 返回完整的响应内容和最后的元数据
|
|
160
163
|
"""
|
|
161
164
|
if console is None:
|
|
162
165
|
console = Console(force_terminal=True, color_system="auto", height=None)
|
|
163
|
-
|
|
166
|
+
|
|
167
|
+
keep_reasoning_content = True
|
|
168
|
+
if args:
|
|
169
|
+
keep_reasoning_content = args.keep_reasoning_content
|
|
170
|
+
|
|
164
171
|
lines_buffer = [] # 存储历史行
|
|
165
172
|
current_line = "" # 当前行
|
|
166
173
|
assistant_response = ""
|
|
167
174
|
last_meta = None
|
|
168
|
-
panel_title = title if title is not None else f"Response[ {model_name} ]"
|
|
175
|
+
panel_title = title if title is not None else f"Response[ {model_name} ]"
|
|
169
176
|
try:
|
|
170
177
|
with Live(
|
|
171
178
|
Panel("", title=panel_title, border_style="green"),
|
|
@@ -179,8 +186,22 @@ def stream_out(
|
|
|
179
186
|
|
|
180
187
|
if reasoning_content == "" and content == "":
|
|
181
188
|
continue
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
|
|
190
|
+
if keep_reasoning_content:
|
|
191
|
+
# 处理思考内容
|
|
192
|
+
if reasoning_content:
|
|
193
|
+
if assistant_response == "": # 首次遇到思考内容时添加开标签
|
|
194
|
+
assistant_response = "<thinking>"
|
|
195
|
+
assistant_response += reasoning_content
|
|
196
|
+
|
|
197
|
+
# 处理正式内容
|
|
198
|
+
if content:
|
|
199
|
+
# 如果之前有思考内容,需要先关闭thinking标签
|
|
200
|
+
if "</thinking>" not in assistant_response and "<thinking>" in assistant_response:
|
|
201
|
+
assistant_response += "</thinking>"
|
|
202
|
+
assistant_response += content
|
|
203
|
+
else:
|
|
204
|
+
assistant_response += content
|
|
184
205
|
|
|
185
206
|
display_delta = reasoning_content if reasoning_content else content
|
|
186
207
|
|
|
@@ -230,7 +251,7 @@ def stream_out(
|
|
|
230
251
|
title=f"Final {panel_title}",
|
|
231
252
|
border_style="blue"
|
|
232
253
|
)
|
|
233
|
-
)
|
|
254
|
+
)
|
|
234
255
|
|
|
235
256
|
except Exception as e:
|
|
236
257
|
console.print(Panel(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.251"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.249"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge_strict_diff.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/plugins/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{auto_coder-0.1.249 → auto_coder-0.1.251}/src/autocoder/utils/chat_auto_coder_utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|