auto-coder 0.1.329__tar.gz → 0.1.331__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.329 → auto_coder-0.1.331}/PKG-INFO +1 -1
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/auto_coder.egg-info/PKG-INFO +1 -1
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/project_reader.py +1 -14
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/auto_coder.py +1 -24
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/command_args.py +1 -6
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/commands/tools.py +0 -13
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/__init__.py +6 -3
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/auto_coder_lang.py +12 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_generate.py +6 -160
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_generate_diff.py +5 -111
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_generate_editblock.py +5 -95
- auto_coder-0.1.331/src/autocoder/common/code_auto_generate_strict_diff.py +437 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_merge_editblock.py +1 -45
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/command_templates.py +2 -9
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/stream_out_type.py +3 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/types.py +2 -1
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_auto_generate.py +6 -4
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_auto_generate_diff.py +4 -3
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_auto_generate_editblock.py +9 -4
- {auto_coder-0.1.329/src/autocoder/common → auto_coder-0.1.331/src/autocoder/common/v2}/code_auto_generate_strict_diff.py +5 -111
- auto_coder-0.1.331/src/autocoder/common/v2/code_auto_merge_diff.py +608 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_auto_merge_editblock.py +11 -44
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_auto_merge_strict_diff.py +76 -7
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_editblock_manager.py +141 -6
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/dispacher/actions/action.py +15 -28
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/dispacher/actions/plugins/action_regex_project.py +5 -9
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/helper/project_creator.py +0 -1
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/entry.py +0 -43
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/filter/normal_filter.py +0 -16
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/lang.py +2 -4
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/python_linter.py +2 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/pyproject/__init__.py +2 -19
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/simple_cache.py +31 -6
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/regexproject/__init__.py +4 -22
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/suffixproject/__init__.py +6 -24
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/tsproject/__init__.py +5 -22
- auto_coder-0.1.331/src/autocoder/version.py +1 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_action_regex_project.py +1 -2
- auto_coder-0.1.329/src/autocoder/common/v2/code_auto_generate_strict_diff.py +0 -269
- auto_coder-0.1.329/src/autocoder/common/v2/code_auto_merge_diff.py +0 -354
- auto_coder-0.1.329/src/autocoder/version.py +0 -1
- {auto_coder-0.1.329 → auto_coder-0.1.331}/LICENSE +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/README.md +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/setup.cfg +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/setup.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/auto_coder.egg-info/SOURCES.txt +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/auto_coder.egg-info/dependency_links.txt +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/auto_coder.egg-info/entry_points.txt +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/auto_coder.egg-info/requires.txt +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/auto_coder.egg-info/top_level.txt +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/auto_demand_organizer.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/auto_filegroup.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/auto_guess_query.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/auto_learn_from_commit.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/auto_review_commit.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/auto_tool.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/coder.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/designer.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/agent/planner.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/auto_coder_rag.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/auto_coder_runner.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/auto_coder_server.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/benchmark.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/chat/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/chat_auto_coder.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/chat_auto_coder_lang.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/command_parser.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/commands/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/commands/auto_command.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/commands/auto_web.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/JupyterClient.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/ShellClient.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/action_yml_file_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/anything2images.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/anything2img.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/audio.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/auto_configure.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/buildin_tokenizer.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/chunk_validation.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/cleaner.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_execute.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_merge.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_merge_diff.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_merge_strict_diff.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_modification_ranker.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/command_completer.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/command_generator.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/computer_use.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/conf_import_export.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/conf_validator.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/const.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/context_pruner.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/conversation_pruner.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/files.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/git_utils.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/global_cancel.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/image_to_page.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/index_import_export.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/interpreter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/llm_rerank.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/mcp_hub.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/mcp_server.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/mcp_servers/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/mcp_servers/mcp_server_gpt4o_mini_search.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/mcp_servers/mcp_server_perplexity.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/mcp_tools.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/memory_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/model_speed_test.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/openai_content.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/printer.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/recall_validation.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/result_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/screenshots.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/search.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/search_replace.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/shells.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/stats_panel.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/sys_prompt.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/text.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/token_cost_caculate.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/utils_code_auto_generate.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_auto_merge.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_diff_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/v2/code_strict_diff_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/base_compiler.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/compiler_config_api.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/compiler_config_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/compiler_factory.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/java_compiler.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/models.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/provided_compiler.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/python_compiler.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/reactjs_compiler.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/shadow_compiler.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/compilers/vue_compiler.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/data/byzerllm.md +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/data/tokenizer.json +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/db/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/db/store.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/dispacher/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/dispacher/actions/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/dispacher/actions/copilot.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/dispacher/actions/plugins/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/events/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/events/event_content.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/events/event_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/events/event_manager_singleton.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/events/event_store.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/events/event_types.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/helper/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/filter/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/filter/quick_filter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/for_command.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/index.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/symbols_utils.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/index/types.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/base_linter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/linter_factory.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/models.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/reactjs_linter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/shadow_linter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/linters/vue_linter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/memory/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/memory/active_context_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/memory/active_package.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/memory/async_processor.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/memory/directory_mapper.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/models.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/plugins/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/plugins/dynamic_completion_example.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/plugins/git_helper_plugin.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/plugins/sample_plugin.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/plugins/token_helper_plugin.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/plugins/utils.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/privacy/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/privacy/model_filter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/api_server.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/base_cache.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/byzer_storage_cache.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/cache_result_merge.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/file_monitor_cache.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/local_byzer_storage_cache.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/local_duckdb_storage_cache.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/cache/rag_file_meta.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/conversation_to_queries.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/doc_filter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/document_retriever.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/lang.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/llm_wrapper.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/loaders/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/loaders/docx_loader.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/loaders/excel_loader.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/loaders/pdf_loader.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/loaders/ppt_loader.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/long_context_rag.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/qa_conversation_strategy.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/rag_config.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/rag_entry.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/raw_rag.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/relevant_utils.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/searchable.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/simple_directory_reader.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/simple_rag.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/stream_event/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/stream_event/event_writer.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/stream_event/types.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/token_checker.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/token_counter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/token_limiter.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/token_limiter_utils.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/types.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/utils.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/rag/variable_holder.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/run_context.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/shadows/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/shadows/shadow_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/_markitdown.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/auto_coder_utils/chat_stream_out.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/auto_project_type.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/chat_auto_coder_utils/__init__.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/conversation_store.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/llm_client_interceptors.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/llms.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/log_capture.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/model_provider_selector.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/multi_turn.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/operate_config_api.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/print_table.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/project_structure.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/queue_communicate.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/request_event_queue.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/request_queue.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/rest.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/stream_thinking.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/tests.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/thread_utils.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/utils/types.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_action_yml_file_manager.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_chat_auto_coder.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_code_auto_merge_editblock.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_command_completer.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_planner.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_plugins.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_privacy.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_queue_communicate.py +0 -0
- {auto_coder-0.1.329 → auto_coder-0.1.331}/tests/test_symbols_utils.py +0 -0
|
@@ -185,20 +185,7 @@ def get_tools(args: AutoCoderArgs, llm: byzerllm.ByzerLLM):
|
|
|
185
185
|
返回值是 用户对你问题的回答。
|
|
186
186
|
|
|
187
187
|
注意,尽量不要询问用户,除非你感受到你无法回答用户的问题。
|
|
188
|
-
'''
|
|
189
|
-
|
|
190
|
-
if args.request_id and not args.silence and not args.skip_events:
|
|
191
|
-
event_data = {
|
|
192
|
-
"question": question
|
|
193
|
-
}
|
|
194
|
-
response_json = queue_communicate.send_event(
|
|
195
|
-
request_id=args.request_id,
|
|
196
|
-
event=CommunicateEvent(
|
|
197
|
-
event_type=CommunicateEventType.ASK_HUMAN.value,
|
|
198
|
-
data=json.dumps(event_data, ensure_ascii=False),
|
|
199
|
-
),
|
|
200
|
-
)
|
|
201
|
-
return response_json
|
|
188
|
+
'''
|
|
202
189
|
|
|
203
190
|
console = Console()
|
|
204
191
|
|
|
@@ -475,30 +475,7 @@ def main(input_args: Optional[List[str]] = None):
|
|
|
475
475
|
border_style="blue",
|
|
476
476
|
expand=False,
|
|
477
477
|
)
|
|
478
|
-
)
|
|
479
|
-
|
|
480
|
-
if args.request_id and not args.silence and not args.skip_events:
|
|
481
|
-
event_data = {
|
|
482
|
-
"instruction": final_ins,
|
|
483
|
-
"model": model,
|
|
484
|
-
"request_id": args.request_id,
|
|
485
|
-
}
|
|
486
|
-
response_json = queue_communicate.send_event(
|
|
487
|
-
request_id=args.request_id,
|
|
488
|
-
event=CommunicateEvent(
|
|
489
|
-
event_type=CommunicateEventType.CODE_HUMAN_AS_MODEL.value,
|
|
490
|
-
data=json.dumps(event_data, ensure_ascii=False),
|
|
491
|
-
),
|
|
492
|
-
)
|
|
493
|
-
response = json.loads(response_json)
|
|
494
|
-
v = [
|
|
495
|
-
{
|
|
496
|
-
"predict": response["value"],
|
|
497
|
-
"input": input_value[0]["instruction"],
|
|
498
|
-
"metadata": {},
|
|
499
|
-
}
|
|
500
|
-
]
|
|
501
|
-
return False, v
|
|
478
|
+
)
|
|
502
479
|
|
|
503
480
|
lines = []
|
|
504
481
|
while True:
|
|
@@ -195,12 +195,7 @@ def parse_args(input_args: Optional[List[str]] = None) -> AutoCoderArgs:
|
|
|
195
195
|
parser.add_argument(
|
|
196
196
|
"--image_max_iter", type=int, default=1, help=desc["image_max_iter"]
|
|
197
197
|
)
|
|
198
|
-
|
|
199
|
-
parser.add_argument(
|
|
200
|
-
"--enable_multi_round_generate",
|
|
201
|
-
action="store_true",
|
|
202
|
-
help=desc["enable_multi_round_generate"],
|
|
203
|
-
)
|
|
198
|
+
|
|
204
199
|
parser.add_argument(
|
|
205
200
|
"--skip_confirm", action="store_true", help=desc["skip_confirm"]
|
|
206
201
|
)
|
|
@@ -105,19 +105,6 @@ class AutoCommandTools:
|
|
|
105
105
|
注意,尽量不要询问用户,除非你感受到你无法回答用户的问题。
|
|
106
106
|
'''
|
|
107
107
|
|
|
108
|
-
if self.args.request_id and not self.args.silence and not self.args.skip_events:
|
|
109
|
-
event_data = {
|
|
110
|
-
"question": question
|
|
111
|
-
}
|
|
112
|
-
response_json = queue_communicate.send_event(
|
|
113
|
-
request_id=self.args.request_id,
|
|
114
|
-
event=CommunicateEvent(
|
|
115
|
-
event_type=CommunicateEventType.ASK_HUMAN.value,
|
|
116
|
-
data=json.dumps(event_data, ensure_ascii=False),
|
|
117
|
-
),
|
|
118
|
-
)
|
|
119
|
-
return response_json
|
|
120
|
-
|
|
121
108
|
# 如果是在web模式下,则使用event_manager事件来询问用户
|
|
122
109
|
if get_run_context().is_web():
|
|
123
110
|
answer = get_event_manager(
|
|
@@ -244,7 +244,7 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
244
244
|
execute: Optional[bool] = None
|
|
245
245
|
package_name: Optional[str] = ""
|
|
246
246
|
script_path: Optional[str] = ""
|
|
247
|
-
|
|
247
|
+
|
|
248
248
|
model: Optional[str] = ""
|
|
249
249
|
chat_model: Optional[str] = ""
|
|
250
250
|
model_max_length: Optional[int] = 2000
|
|
@@ -326,13 +326,14 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
326
326
|
image_max_iter: Optional[int] = 1
|
|
327
327
|
|
|
328
328
|
urls: Optional[Union[str, List[str]]] = ""
|
|
329
|
-
urls_use_model: Optional[bool] = False
|
|
330
|
-
enable_multi_round_generate: Optional[bool] = False
|
|
329
|
+
urls_use_model: Optional[bool] = False
|
|
331
330
|
command: Optional[str] = None
|
|
332
331
|
doc_command: Optional[str] = None
|
|
333
332
|
required_exts: Optional[str] = None
|
|
334
333
|
hybrid_index_max_output_tokens: Optional[int] = 1000000
|
|
335
334
|
|
|
335
|
+
enable_multi_round_generate: Optional[bool] = False
|
|
336
|
+
|
|
336
337
|
monitor_mode: bool = False
|
|
337
338
|
enable_hybrid_index: bool = False
|
|
338
339
|
rag_build_name: Optional[str] = None
|
|
@@ -420,9 +421,11 @@ class AutoCoderArgs(pydantic.BaseModel):
|
|
|
420
421
|
|
|
421
422
|
enable_auto_fix_lint: Optional[bool] = False
|
|
422
423
|
enable_auto_fix_compile: Optional[bool] = False
|
|
424
|
+
enable_auto_fix_merge: Optional[bool] = False
|
|
423
425
|
|
|
424
426
|
auto_fix_lint_max_attempts: Optional[int] = 5
|
|
425
427
|
auto_fix_compile_max_attempts: Optional[int] = 5
|
|
428
|
+
auto_fix_merge_max_attempts: Optional[int] = 5
|
|
426
429
|
|
|
427
430
|
ignore_clean_shadows: Optional[bool] = False
|
|
428
431
|
|
|
@@ -773,6 +773,18 @@ MESSAGES = {
|
|
|
773
773
|
"max_compile_attempts_reached": {
|
|
774
774
|
"en": "Maximum compilation attempts reached",
|
|
775
775
|
"zh": "已达到最大编译尝试次数"
|
|
776
|
+
},
|
|
777
|
+
"unmerged_blocks_fixed": {
|
|
778
|
+
"en": "Unmerged blocks fixed successfully",
|
|
779
|
+
"zh": "未合并代码块已成功修复"
|
|
780
|
+
},
|
|
781
|
+
"unmerged_blocks_attempt_status": {
|
|
782
|
+
"en": "Fixing unmerged blocks attempt {{attempt}}/{{max_correction_attempts}}",
|
|
783
|
+
"zh": "正在尝试修复未合并代码块 {{attempt}}/{{max_correction_attempts}}"
|
|
784
|
+
},
|
|
785
|
+
"max_unmerged_blocks_attempts_reached": {
|
|
786
|
+
"en": "Maximum unmerged blocks fix attempts reached",
|
|
787
|
+
"zh": "已达到最大未合并代码块修复尝试次数"
|
|
776
788
|
}
|
|
777
789
|
}
|
|
778
790
|
|
|
@@ -51,69 +51,7 @@ class CodeAutoGenerate:
|
|
|
51
51
|
{{ instruction }}
|
|
52
52
|
|
|
53
53
|
"""
|
|
54
|
-
|
|
55
|
-
@byzerllm.prompt(llm=lambda self: self.llm)
|
|
56
|
-
def multi_round_instruction(
|
|
57
|
-
self, instruction: str, content: str, context: str = "", package_context: str = ""
|
|
58
|
-
) -> str:
|
|
59
|
-
"""
|
|
60
|
-
{%- if structure %}
|
|
61
|
-
{{ structure }}
|
|
62
|
-
{%- endif %}
|
|
63
|
-
|
|
64
|
-
{%- if content %}
|
|
65
|
-
下面是一些文件路径以及每个文件对应的源码:
|
|
66
|
-
<files>
|
|
67
|
-
{{ content }}
|
|
68
|
-
</files>
|
|
69
|
-
{%- endif %}
|
|
70
|
-
|
|
71
|
-
{%- if package_context %}
|
|
72
|
-
下面是上面文件的一些信息(包括最近的变更情况):
|
|
73
|
-
<package_context>
|
|
74
|
-
{{ package_context }}
|
|
75
|
-
</package_context>
|
|
76
|
-
{%- endif %}
|
|
77
|
-
|
|
78
|
-
{%- if context %}
|
|
79
|
-
<extra_context>
|
|
80
|
-
{{ context }}
|
|
81
|
-
</extra_context>
|
|
82
|
-
{%- endif %}
|
|
83
|
-
|
|
84
|
-
下面是用户的需求:
|
|
85
|
-
|
|
86
|
-
{{ instruction }}
|
|
87
|
-
|
|
88
|
-
如果你需要生成代码,你生成的代码要符合这个格式:
|
|
89
|
-
|
|
90
|
-
```{lang}
|
|
91
|
-
##File: {FILE_PATH}
|
|
92
|
-
{CODE}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
```{lang}
|
|
96
|
-
##File: {FILE_PATH}
|
|
97
|
-
{CODE}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
其中,{lang}是代码的语言,{CODE}是代码的内容, {FILE_PATH} 是文件的路径(请尽量使用绝对路径),他们都在代码块中,请严格按上面的格式进行内容生成。
|
|
101
|
-
每次生成一个文件的代码,然后询问我是否继续,当我回复继续,继续生成下一个文件的代码。当没有后续任务时,请回复 "__完成__" 或者 "__EOF__"。
|
|
102
|
-
请确保每份代码的完整性,而不要只生成修改部分。
|
|
103
|
-
"""
|
|
104
|
-
|
|
105
|
-
if not self.args.include_project_structure:
|
|
106
|
-
return {
|
|
107
|
-
"structure": "",
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
"structure": (
|
|
112
|
-
self.action.pp.get_tree_like_directory_structure()
|
|
113
|
-
if self.action
|
|
114
|
-
else ""
|
|
115
|
-
)
|
|
116
|
-
}
|
|
54
|
+
|
|
117
55
|
|
|
118
56
|
@byzerllm.prompt(llm=lambda self: self.llm)
|
|
119
57
|
def single_round_instruction(
|
|
@@ -197,15 +135,6 @@ class CodeAutoGenerate:
|
|
|
197
135
|
source_code_list = SourceCodeList(filtered_sources)
|
|
198
136
|
source_content = source_code_list.to_str()
|
|
199
137
|
|
|
200
|
-
if self.args.request_id and not self.args.skip_events:
|
|
201
|
-
queue_communicate.send_event_no_wait(
|
|
202
|
-
request_id=self.args.request_id,
|
|
203
|
-
event=CommunicateEvent(
|
|
204
|
-
event_type=CommunicateEventType.CODE_GENERATE_START.value,
|
|
205
|
-
data=query,
|
|
206
|
-
),
|
|
207
|
-
)
|
|
208
|
-
|
|
209
138
|
# 获取包上下文信息
|
|
210
139
|
package_context = ""
|
|
211
140
|
|
|
@@ -264,15 +193,16 @@ class CodeAutoGenerate:
|
|
|
264
193
|
if not self.args.human_as_model:
|
|
265
194
|
with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
|
|
266
195
|
futures = []
|
|
196
|
+
count = 0
|
|
267
197
|
for llm in self.llms:
|
|
268
198
|
model_names_list = llm_utils.get_llm_names(llm)
|
|
269
199
|
model_name = None
|
|
270
200
|
if model_names_list:
|
|
271
201
|
model_name = model_names_list[0]
|
|
272
202
|
|
|
273
|
-
for
|
|
203
|
+
for _ in range(self.generate_times_same_model):
|
|
274
204
|
model_names.append(model_name)
|
|
275
|
-
if
|
|
205
|
+
if count == 0:
|
|
276
206
|
def job():
|
|
277
207
|
stream_generator = stream_chat_with_continue(
|
|
278
208
|
llm=llm,
|
|
@@ -303,7 +233,7 @@ class CodeAutoGenerate:
|
|
|
303
233
|
llm_config=llm_config,
|
|
304
234
|
args=self.args
|
|
305
235
|
))
|
|
306
|
-
|
|
236
|
+
count += 1
|
|
307
237
|
temp_results = [future.result() for future in futures]
|
|
308
238
|
for result in temp_results:
|
|
309
239
|
results.append(result.content)
|
|
@@ -338,90 +268,6 @@ class CodeAutoGenerate:
|
|
|
338
268
|
"generated_tokens_cost": generated_tokens_cost
|
|
339
269
|
}
|
|
340
270
|
|
|
341
|
-
if self.args.request_id and not self.args.skip_events:
|
|
342
|
-
queue_communicate.send_event_no_wait(
|
|
343
|
-
request_id=self.args.request_id,
|
|
344
|
-
event=CommunicateEvent(
|
|
345
|
-
event_type=CommunicateEventType.CODE_GENERATE_END.value,
|
|
346
|
-
data=json.dumps(statistics, ensure_ascii=False),
|
|
347
|
-
),
|
|
348
|
-
)
|
|
349
|
-
|
|
350
271
|
return CodeGenerateResult(contents=results, conversations=conversations_list, metadata=statistics)
|
|
351
272
|
|
|
352
|
-
|
|
353
|
-
self, query: str, source_code_list: SourceCodeList, max_steps: int = 10
|
|
354
|
-
) -> Tuple[List[str], List[Dict[str, str]]]:
|
|
355
|
-
llm_config = {"human_as_model": self.args.human_as_model}
|
|
356
|
-
result = []
|
|
357
|
-
source_content = source_code_list.to_str()
|
|
358
|
-
|
|
359
|
-
# 获取包上下文信息
|
|
360
|
-
package_context = ""
|
|
361
|
-
|
|
362
|
-
if self.args.enable_active_context:
|
|
363
|
-
# 初始化活动上下文管理器
|
|
364
|
-
active_context_manager = ActiveContextManager(self.llm, self.args.source_dir)
|
|
365
|
-
# 获取活动上下文信息
|
|
366
|
-
result = active_context_manager.load_active_contexts_for_files(
|
|
367
|
-
[source.module_name for source in source_code_list.sources]
|
|
368
|
-
)
|
|
369
|
-
# 将活动上下文信息格式化为文本
|
|
370
|
-
if result.contexts:
|
|
371
|
-
package_context_parts = []
|
|
372
|
-
for dir_path, context in result.contexts.items():
|
|
373
|
-
package_context_parts.append(f"<package_info>{context.content}</package_info>")
|
|
374
|
-
|
|
375
|
-
package_context = "\n".join(package_context_parts)
|
|
376
|
-
|
|
377
|
-
if self.args.template == "common":
|
|
378
|
-
init_prompt = self.multi_round_instruction.prompt(
|
|
379
|
-
instruction=query, content=source_content, context=self.args.context,
|
|
380
|
-
package_context=package_context
|
|
381
|
-
)
|
|
382
|
-
elif self.args.template == "auto_implement":
|
|
383
|
-
init_prompt = self.auto_implement_function.prompt(
|
|
384
|
-
instruction=query, content=source_content
|
|
385
|
-
)
|
|
386
|
-
|
|
387
|
-
conversations = [{"role": "user", "content": init_prompt}]
|
|
388
|
-
|
|
389
|
-
with open(self.args.target_file, "w",encoding="utf-8") as file:
|
|
390
|
-
file.write(init_prompt)
|
|
391
|
-
|
|
392
|
-
t = self.llm.chat_oai(conversations=conversations, llm_config=llm_config)
|
|
393
|
-
|
|
394
|
-
result.append(t[0].output)
|
|
395
|
-
|
|
396
|
-
conversations.append({"role": "assistant", "content": t[0].output})
|
|
397
|
-
|
|
398
|
-
if (
|
|
399
|
-
"__完成__" in t[0].output
|
|
400
|
-
or "/done" in t[0].output
|
|
401
|
-
or "__EOF__" in t[0].output
|
|
402
|
-
):
|
|
403
|
-
return result, conversations
|
|
404
|
-
|
|
405
|
-
current_step = 0
|
|
406
|
-
|
|
407
|
-
while current_step < max_steps:
|
|
408
|
-
|
|
409
|
-
conversations.append({"role": "user", "content": "继续"})
|
|
410
|
-
|
|
411
|
-
with open(self.args.target_file, "w",encoding="utf-8") as file:
|
|
412
|
-
file.write("继续")
|
|
413
|
-
|
|
414
|
-
t = self.llm.chat_oai(conversations=conversations, llm_config=llm_config)
|
|
415
|
-
|
|
416
|
-
result.append(t[0].output)
|
|
417
|
-
conversations.append({"role": "assistant", "content": t[0].output})
|
|
418
|
-
current_step += 1
|
|
419
|
-
|
|
420
|
-
if (
|
|
421
|
-
"__完成__" in t[0].output
|
|
422
|
-
or "/done" in t[0].output
|
|
423
|
-
or "__EOF__" in t[0].output
|
|
424
|
-
):
|
|
425
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
426
|
-
|
|
427
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
273
|
+
|
|
@@ -365,15 +365,6 @@ class CodeAutoGenerateDiff:
|
|
|
365
365
|
|
|
366
366
|
conversations.append({"role": "user", "content": init_prompt})
|
|
367
367
|
|
|
368
|
-
if self.args.request_id and not self.args.skip_events:
|
|
369
|
-
_ = queue_communicate.send_event(
|
|
370
|
-
request_id=self.args.request_id,
|
|
371
|
-
event=CommunicateEvent(
|
|
372
|
-
event_type=CommunicateEventType.CODE_GENERATE_START.value,
|
|
373
|
-
data=json.dumps({}, ensure_ascii=False),
|
|
374
|
-
),
|
|
375
|
-
)
|
|
376
|
-
|
|
377
368
|
conversations_list = []
|
|
378
369
|
results = []
|
|
379
370
|
input_tokens_count = 0
|
|
@@ -392,6 +383,7 @@ class CodeAutoGenerateDiff:
|
|
|
392
383
|
if not self.args.human_as_model:
|
|
393
384
|
with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
|
|
394
385
|
futures = []
|
|
386
|
+
count = 0
|
|
395
387
|
for llm in self.llms:
|
|
396
388
|
|
|
397
389
|
model_names_list = llm_utils.get_llm_names(llm)
|
|
@@ -399,9 +391,9 @@ class CodeAutoGenerateDiff:
|
|
|
399
391
|
if model_names_list:
|
|
400
392
|
model_name = model_names_list[0]
|
|
401
393
|
|
|
402
|
-
for
|
|
394
|
+
for _ in range(self.generate_times_same_model):
|
|
403
395
|
model_names.append(model_name)
|
|
404
|
-
if
|
|
396
|
+
if count == 0:
|
|
405
397
|
def job():
|
|
406
398
|
stream_generator = stream_chat_with_continue(
|
|
407
399
|
llm=llm,
|
|
@@ -432,7 +424,7 @@ class CodeAutoGenerateDiff:
|
|
|
432
424
|
llm_config=llm_config,
|
|
433
425
|
args=self.args
|
|
434
426
|
))
|
|
435
|
-
|
|
427
|
+
count += 1
|
|
436
428
|
temp_results = [future.result() for future in futures]
|
|
437
429
|
for result in temp_results:
|
|
438
430
|
results.append(result.content)
|
|
@@ -468,104 +460,6 @@ class CodeAutoGenerateDiff:
|
|
|
468
460
|
"generated_tokens_cost": generated_tokens_cost
|
|
469
461
|
}
|
|
470
462
|
|
|
471
|
-
if self.args.request_id and not self.args.skip_events:
|
|
472
|
-
_ = queue_communicate.send_event(
|
|
473
|
-
request_id=self.args.request_id,
|
|
474
|
-
event=CommunicateEvent(
|
|
475
|
-
event_type=CommunicateEventType.CODE_GENERATE_END.value,
|
|
476
|
-
data=json.dumps(statistics, ensure_ascii=False),
|
|
477
|
-
),
|
|
478
|
-
)
|
|
479
463
|
|
|
480
464
|
return CodeGenerateResult(contents=results, conversations=conversations_list, metadata=statistics)
|
|
481
|
-
|
|
482
|
-
def multi_round_run(
|
|
483
|
-
self, query: str, source_code_list: SourceCodeList, max_steps: int = 10
|
|
484
|
-
) -> CodeGenerateResult:
|
|
485
|
-
|
|
486
|
-
# Apply model filter for code_llm
|
|
487
|
-
printer = Printer()
|
|
488
|
-
for llm in self.llms:
|
|
489
|
-
model_filter = ModelPathFilter.from_model_object(llm, self.args)
|
|
490
|
-
filtered_sources = []
|
|
491
|
-
for source in source_code_list.sources:
|
|
492
|
-
if model_filter.is_accessible(source.module_name):
|
|
493
|
-
filtered_sources.append(source)
|
|
494
|
-
else:
|
|
495
|
-
printer.print_in_terminal("index_file_filtered",
|
|
496
|
-
style="yellow",
|
|
497
|
-
file_path=source.path,
|
|
498
|
-
model_name=",".join(llm_utils.get_llm_names(llm)))
|
|
499
|
-
|
|
500
|
-
source_code_list = SourceCodeList(filtered_sources)
|
|
501
|
-
|
|
502
|
-
llm_config = {"human_as_model": self.args.human_as_model}
|
|
503
|
-
result = []
|
|
504
|
-
source_content = source_code_list.to_str()
|
|
505
|
-
|
|
506
|
-
# 获取包上下文信息
|
|
507
|
-
package_context = ""
|
|
508
|
-
|
|
509
|
-
if self.args.enable_active_context:
|
|
510
|
-
# 初始化活动上下文管理器
|
|
511
|
-
active_context_manager = ActiveContextManager(self.llm, self.args.source_dir)
|
|
512
|
-
# 获取活动上下文信息
|
|
513
|
-
result = active_context_manager.load_active_contexts_for_files(
|
|
514
|
-
[source.module_name for source in source_code_list.sources]
|
|
515
|
-
)
|
|
516
|
-
# 将活动上下文信息格式化为文本
|
|
517
|
-
if result.contexts:
|
|
518
|
-
package_context_parts = []
|
|
519
|
-
for dir_path, context in result.contexts.items():
|
|
520
|
-
package_context_parts.append(f"<package_info>{context.content}</package_info>")
|
|
521
|
-
|
|
522
|
-
package_context = "\n".join(package_context_parts)
|
|
523
|
-
|
|
524
|
-
if self.args.template == "common":
|
|
525
|
-
init_prompt = self.multi_round_instruction.prompt(
|
|
526
|
-
instruction=query, content=source_content, context=self.args.context,
|
|
527
|
-
package_context=package_context
|
|
528
|
-
)
|
|
529
|
-
elif self.args.template == "auto_implement":
|
|
530
|
-
init_prompt = self.auto_implement_function.prompt(
|
|
531
|
-
instruction=query, content=source_content
|
|
532
|
-
)
|
|
533
|
-
|
|
534
|
-
conversations = []
|
|
535
|
-
# conversations.append({"role": "system", "content": sys_prompt.prompt()})
|
|
536
|
-
conversations.append({"role": "user", "content": init_prompt})
|
|
537
|
-
|
|
538
|
-
with open(self.args.target_file, "w",encoding="utf-8") as file:
|
|
539
|
-
file.write(init_prompt)
|
|
540
|
-
|
|
541
|
-
code_llm = self.llms[0]
|
|
542
|
-
t = code_llm.chat_oai(conversations=conversations,
|
|
543
|
-
llm_config=llm_config)
|
|
544
|
-
|
|
545
|
-
result.append(t[0].output)
|
|
546
|
-
|
|
547
|
-
conversations.append({"role": "assistant", "content": t[0].output})
|
|
548
|
-
|
|
549
|
-
if "__完成__" in t[0].output or "/done" in t[0].output or "__EOF__" in t[0].output:
|
|
550
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
551
|
-
|
|
552
|
-
current_step = 0
|
|
553
|
-
|
|
554
|
-
while current_step < max_steps:
|
|
555
|
-
|
|
556
|
-
conversations.append({"role": "user", "content": "继续"})
|
|
557
|
-
|
|
558
|
-
with open(self.args.target_file, "w",encoding="utf-8") as file:
|
|
559
|
-
file.write("继续")
|
|
560
|
-
|
|
561
|
-
t = code_llm.chat_oai(
|
|
562
|
-
conversations=conversations, llm_config=llm_config)
|
|
563
|
-
|
|
564
|
-
result.append(t[0].output)
|
|
565
|
-
conversations.append({"role": "assistant", "content": t[0].output})
|
|
566
|
-
current_step += 1
|
|
567
|
-
|
|
568
|
-
if "__完成__" in t[0].output or "/done" in t[0].output or "__EOF__" in t[0].output:
|
|
569
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
570
|
-
|
|
571
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
465
|
+
|
{auto_coder-0.1.329 → auto_coder-0.1.331}/src/autocoder/common/code_auto_generate_editblock.py
RENAMED
|
@@ -474,15 +474,6 @@ class CodeAutoGenerateEditBlock:
|
|
|
474
474
|
|
|
475
475
|
conversations.append({"role": "user", "content": init_prompt})
|
|
476
476
|
|
|
477
|
-
if self.args.request_id and not self.args.skip_events:
|
|
478
|
-
_ = queue_communicate.send_event(
|
|
479
|
-
request_id=self.args.request_id,
|
|
480
|
-
event=CommunicateEvent(
|
|
481
|
-
event_type=CommunicateEventType.CODE_GENERATE_START.value,
|
|
482
|
-
data=json.dumps({}, ensure_ascii=False),
|
|
483
|
-
),
|
|
484
|
-
)
|
|
485
|
-
|
|
486
477
|
conversations_list = []
|
|
487
478
|
results = []
|
|
488
479
|
input_tokens_count = 0
|
|
@@ -505,6 +496,7 @@ class CodeAutoGenerateEditBlock:
|
|
|
505
496
|
if not self.args.human_as_model:
|
|
506
497
|
with ThreadPoolExecutor(max_workers=len(self.llms) * self.generate_times_same_model) as executor:
|
|
507
498
|
futures = []
|
|
499
|
+
count = 0
|
|
508
500
|
for llm in self.llms:
|
|
509
501
|
|
|
510
502
|
model_names_list = llm_utils.get_llm_names(llm)
|
|
@@ -512,9 +504,9 @@ class CodeAutoGenerateEditBlock:
|
|
|
512
504
|
if model_names_list:
|
|
513
505
|
model_name = model_names_list[0]
|
|
514
506
|
|
|
515
|
-
for
|
|
507
|
+
for _ in range(self.generate_times_same_model):
|
|
516
508
|
model_names.append(model_name)
|
|
517
|
-
if
|
|
509
|
+
if count == 0:
|
|
518
510
|
def job():
|
|
519
511
|
stream_generator = stream_chat_with_continue(
|
|
520
512
|
llm=llm,
|
|
@@ -545,6 +537,7 @@ class CodeAutoGenerateEditBlock:
|
|
|
545
537
|
llm_config=llm_config,
|
|
546
538
|
args=self.args
|
|
547
539
|
))
|
|
540
|
+
count += 1
|
|
548
541
|
|
|
549
542
|
temp_results = [future.result() for future in futures]
|
|
550
543
|
|
|
@@ -582,88 +575,5 @@ class CodeAutoGenerateEditBlock:
|
|
|
582
575
|
"generated_tokens_cost": generated_tokens_cost
|
|
583
576
|
}
|
|
584
577
|
|
|
585
|
-
if self.args.request_id and not self.args.skip_events:
|
|
586
|
-
_ = queue_communicate.send_event(
|
|
587
|
-
request_id=self.args.request_id,
|
|
588
|
-
event=CommunicateEvent(
|
|
589
|
-
event_type=CommunicateEventType.CODE_GENERATE_END.value,
|
|
590
|
-
data=json.dumps(statistics, ensure_ascii=False),
|
|
591
|
-
),
|
|
592
|
-
)
|
|
593
|
-
|
|
594
578
|
return CodeGenerateResult(contents=results, conversations=conversations_list, metadata=statistics)
|
|
595
|
-
|
|
596
|
-
def multi_round_run(
|
|
597
|
-
self, query: str, source_code_list: SourceCodeList, max_steps: int = 10
|
|
598
|
-
) -> CodeGenerateResult:
|
|
599
|
-
llm_config = {"human_as_model": self.args.human_as_model}
|
|
600
|
-
result = []
|
|
601
|
-
source_content = source_code_list.to_str()
|
|
602
|
-
|
|
603
|
-
# 获取包上下文信息
|
|
604
|
-
package_context = ""
|
|
605
|
-
|
|
606
|
-
if self.args.enable_active_context:
|
|
607
|
-
# 初始化活动上下文管理器
|
|
608
|
-
active_context_manager = ActiveContextManager(self.llm, self.args.source_dir)
|
|
609
|
-
# 获取活动上下文信息
|
|
610
|
-
result = active_context_manager.load_active_contexts_for_files(
|
|
611
|
-
[source.module_name for source in source_code_list.sources]
|
|
612
|
-
)
|
|
613
|
-
# 将活动上下文信息格式化为文本
|
|
614
|
-
if result.contexts:
|
|
615
|
-
package_context_parts = []
|
|
616
|
-
for dir_path, context in result.contexts.items():
|
|
617
|
-
package_context_parts.append(f"<package_info>{context.content}</package_info>")
|
|
618
|
-
|
|
619
|
-
package_context = "\n".join(package_context_parts)
|
|
620
|
-
|
|
621
|
-
if self.args.template == "common":
|
|
622
|
-
init_prompt = self.multi_round_instruction.prompt(
|
|
623
|
-
instruction=query, content=source_content, context=self.args.context,
|
|
624
|
-
package_context=package_context
|
|
625
|
-
)
|
|
626
|
-
elif self.args.template == "auto_implement":
|
|
627
|
-
init_prompt = self.auto_implement_function.prompt(
|
|
628
|
-
instruction=query, content=source_content
|
|
629
|
-
)
|
|
630
|
-
|
|
631
|
-
conversations = []
|
|
632
|
-
# conversations.append({"role": "system", "content": sys_prompt.prompt()})
|
|
633
|
-
conversations.append({"role": "user", "content": init_prompt})
|
|
634
|
-
|
|
635
|
-
with open(self.args.target_file, "w",encoding="utf-8") as file:
|
|
636
|
-
file.write(init_prompt)
|
|
637
|
-
|
|
638
|
-
code_llm = self.llms[0]
|
|
639
|
-
t = code_llm.chat_oai(conversations=conversations,
|
|
640
|
-
llm_config=llm_config)
|
|
641
|
-
|
|
642
|
-
result.append(t[0].output)
|
|
643
|
-
|
|
644
|
-
conversations.append({"role": "assistant", "content": t[0].output})
|
|
645
|
-
|
|
646
|
-
if "__完成__" in t[0].output or "/done" in t[0].output or "__EOF__" in t[0].output:
|
|
647
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
648
|
-
|
|
649
|
-
current_step = 0
|
|
650
|
-
|
|
651
|
-
while current_step < max_steps:
|
|
652
|
-
|
|
653
|
-
conversations.append({"role": "user", "content": "继续"})
|
|
654
|
-
|
|
655
|
-
with open(self.args.target_file, "w",encoding="utf-8") as file:
|
|
656
|
-
file.write("继续")
|
|
657
|
-
|
|
658
|
-
t = code_llm.chat_oai(
|
|
659
|
-
conversations=conversations, llm_config=llm_config)
|
|
660
|
-
|
|
661
|
-
result.append(t[0].output)
|
|
662
|
-
conversations.append({"role": "assistant", "content": t[0].output})
|
|
663
|
-
current_step += 1
|
|
664
|
-
|
|
665
|
-
if "__完成__" in t[0].output or "/done" in t[0].output or "__EOF__" in t[0].output:
|
|
666
|
-
|
|
667
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
668
|
-
|
|
669
|
-
return CodeGenerateResult(contents=["\n\n".join(result)], conversations=[conversations])
|
|
579
|
+
|