auto-coder 0.1.250__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.250 → auto_coder-0.1.251}/PKG-INFO +1 -1
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/auto_coder.egg-info/PKG-INFO +1 -1
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/auto_coder.py +8 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/chat_auto_coder.py +2 -2
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/__init__.py +1 -1
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/auto_coder_lang.py +5 -1
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate.py +10 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_diff.py +10 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_editblock.py +22 -8
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_generate_strict_diff.py +10 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/printer.py +4 -1
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/index.py +5 -1
- auto_coder-0.1.251/src/autocoder/version.py +1 -0
- auto_coder-0.1.250/src/autocoder/version.py +0 -1
- {auto_coder-0.1.250 → auto_coder-0.1.251}/LICENSE +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/README.md +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/setup.cfg +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/setup.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/auto_coder.egg-info/SOURCES.txt +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/auto_review_commit.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/agent/project_reader.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/auto_coder_rag_client_mcp.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/auto_coder_rag_mcp.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/command_args.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/command_templates.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/shells.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/types.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/common/utils_code_auto_generate.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/action.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/dispacher/actions/plugins/action_translate.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/entry.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/filter/normal_filter.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/filter/quick_filter.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/lang.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/pyproject/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/cache/simple_cache.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/regexproject/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/suffixproject/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/tsproject/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/tests/test_action_regex_project.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/tests/test_planner.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.250 → auto_coder-0.1.251}/tests/test_symbols_utils.py +0 -0
|
@@ -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,
|
|
@@ -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
|
|
@@ -357,7 +357,7 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
357
357
|
enable_global_memory: Optional[bool] = True
|
|
358
358
|
product_mode: Optional[str] = "lite"
|
|
359
359
|
|
|
360
|
-
keep_reasoning_content: Optional[bool] =
|
|
360
|
+
keep_reasoning_content: Optional[bool] = False
|
|
361
361
|
|
|
362
362
|
in_code_apply: bool = False
|
|
363
363
|
|
|
@@ -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.250 → 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.250 → 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 = []
|
|
@@ -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):
|
|
@@ -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:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.251"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.250"
|
|
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.250 → 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
|
|
File without changes
|
{auto_coder-0.1.250 → 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.250 → 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
|
|
File without changes
|
{auto_coder-0.1.250 → auto_coder-0.1.251}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py
RENAMED
|
File without changes
|
{auto_coder-0.1.250 → 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
|