aider-ce 0.88.20__py3-none-any.whl
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.
- aider/__init__.py +20 -0
- aider/__main__.py +4 -0
- aider/_version.py +34 -0
- aider/analytics.py +258 -0
- aider/args.py +1056 -0
- aider/args_formatter.py +228 -0
- aider/change_tracker.py +133 -0
- aider/coders/__init__.py +36 -0
- aider/coders/agent_coder.py +2166 -0
- aider/coders/agent_prompts.py +104 -0
- aider/coders/architect_coder.py +48 -0
- aider/coders/architect_prompts.py +40 -0
- aider/coders/ask_coder.py +9 -0
- aider/coders/ask_prompts.py +35 -0
- aider/coders/base_coder.py +3613 -0
- aider/coders/base_prompts.py +87 -0
- aider/coders/chat_chunks.py +64 -0
- aider/coders/context_coder.py +53 -0
- aider/coders/context_prompts.py +75 -0
- aider/coders/editblock_coder.py +657 -0
- aider/coders/editblock_fenced_coder.py +10 -0
- aider/coders/editblock_fenced_prompts.py +143 -0
- aider/coders/editblock_func_coder.py +141 -0
- aider/coders/editblock_func_prompts.py +27 -0
- aider/coders/editblock_prompts.py +175 -0
- aider/coders/editor_diff_fenced_coder.py +9 -0
- aider/coders/editor_diff_fenced_prompts.py +11 -0
- aider/coders/editor_editblock_coder.py +9 -0
- aider/coders/editor_editblock_prompts.py +21 -0
- aider/coders/editor_whole_coder.py +9 -0
- aider/coders/editor_whole_prompts.py +12 -0
- aider/coders/help_coder.py +16 -0
- aider/coders/help_prompts.py +46 -0
- aider/coders/patch_coder.py +706 -0
- aider/coders/patch_prompts.py +159 -0
- aider/coders/search_replace.py +757 -0
- aider/coders/shell.py +37 -0
- aider/coders/single_wholefile_func_coder.py +102 -0
- aider/coders/single_wholefile_func_prompts.py +27 -0
- aider/coders/udiff_coder.py +429 -0
- aider/coders/udiff_prompts.py +115 -0
- aider/coders/udiff_simple.py +14 -0
- aider/coders/udiff_simple_prompts.py +25 -0
- aider/coders/wholefile_coder.py +144 -0
- aider/coders/wholefile_func_coder.py +134 -0
- aider/coders/wholefile_func_prompts.py +27 -0
- aider/coders/wholefile_prompts.py +65 -0
- aider/commands.py +2173 -0
- aider/copypaste.py +72 -0
- aider/deprecated.py +126 -0
- aider/diffs.py +128 -0
- aider/dump.py +29 -0
- aider/editor.py +147 -0
- aider/exceptions.py +115 -0
- aider/format_settings.py +26 -0
- aider/gui.py +545 -0
- aider/help.py +163 -0
- aider/help_pats.py +19 -0
- aider/helpers/__init__.py +9 -0
- aider/helpers/similarity.py +98 -0
- aider/history.py +180 -0
- aider/io.py +1608 -0
- aider/linter.py +304 -0
- aider/llm.py +55 -0
- aider/main.py +1415 -0
- aider/mcp/__init__.py +174 -0
- aider/mcp/server.py +149 -0
- aider/mdstream.py +243 -0
- aider/models.py +1313 -0
- aider/onboarding.py +429 -0
- aider/openrouter.py +129 -0
- aider/prompts.py +56 -0
- aider/queries/tree-sitter-language-pack/README.md +7 -0
- aider/queries/tree-sitter-language-pack/arduino-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/c-tags.scm +9 -0
- aider/queries/tree-sitter-language-pack/chatito-tags.scm +16 -0
- aider/queries/tree-sitter-language-pack/clojure-tags.scm +7 -0
- aider/queries/tree-sitter-language-pack/commonlisp-tags.scm +122 -0
- aider/queries/tree-sitter-language-pack/cpp-tags.scm +15 -0
- aider/queries/tree-sitter-language-pack/csharp-tags.scm +26 -0
- aider/queries/tree-sitter-language-pack/d-tags.scm +26 -0
- aider/queries/tree-sitter-language-pack/dart-tags.scm +92 -0
- aider/queries/tree-sitter-language-pack/elisp-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/elixir-tags.scm +54 -0
- aider/queries/tree-sitter-language-pack/elm-tags.scm +19 -0
- aider/queries/tree-sitter-language-pack/gleam-tags.scm +41 -0
- aider/queries/tree-sitter-language-pack/go-tags.scm +42 -0
- aider/queries/tree-sitter-language-pack/java-tags.scm +20 -0
- aider/queries/tree-sitter-language-pack/javascript-tags.scm +88 -0
- aider/queries/tree-sitter-language-pack/lua-tags.scm +34 -0
- aider/queries/tree-sitter-language-pack/matlab-tags.scm +10 -0
- aider/queries/tree-sitter-language-pack/ocaml-tags.scm +115 -0
- aider/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +98 -0
- aider/queries/tree-sitter-language-pack/pony-tags.scm +39 -0
- aider/queries/tree-sitter-language-pack/properties-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/python-tags.scm +14 -0
- aider/queries/tree-sitter-language-pack/r-tags.scm +21 -0
- aider/queries/tree-sitter-language-pack/racket-tags.scm +12 -0
- aider/queries/tree-sitter-language-pack/ruby-tags.scm +64 -0
- aider/queries/tree-sitter-language-pack/rust-tags.scm +60 -0
- aider/queries/tree-sitter-language-pack/solidity-tags.scm +43 -0
- aider/queries/tree-sitter-language-pack/swift-tags.scm +51 -0
- aider/queries/tree-sitter-language-pack/udev-tags.scm +20 -0
- aider/queries/tree-sitter-languages/README.md +24 -0
- aider/queries/tree-sitter-languages/c-tags.scm +9 -0
- aider/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
- aider/queries/tree-sitter-languages/cpp-tags.scm +15 -0
- aider/queries/tree-sitter-languages/dart-tags.scm +91 -0
- aider/queries/tree-sitter-languages/elisp-tags.scm +8 -0
- aider/queries/tree-sitter-languages/elixir-tags.scm +54 -0
- aider/queries/tree-sitter-languages/elm-tags.scm +19 -0
- aider/queries/tree-sitter-languages/fortran-tags.scm +15 -0
- aider/queries/tree-sitter-languages/go-tags.scm +30 -0
- aider/queries/tree-sitter-languages/haskell-tags.scm +3 -0
- aider/queries/tree-sitter-languages/hcl-tags.scm +77 -0
- aider/queries/tree-sitter-languages/java-tags.scm +20 -0
- aider/queries/tree-sitter-languages/javascript-tags.scm +88 -0
- aider/queries/tree-sitter-languages/julia-tags.scm +60 -0
- aider/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
- aider/queries/tree-sitter-languages/matlab-tags.scm +10 -0
- aider/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
- aider/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
- aider/queries/tree-sitter-languages/php-tags.scm +26 -0
- aider/queries/tree-sitter-languages/python-tags.scm +12 -0
- aider/queries/tree-sitter-languages/ql-tags.scm +26 -0
- aider/queries/tree-sitter-languages/ruby-tags.scm +64 -0
- aider/queries/tree-sitter-languages/rust-tags.scm +60 -0
- aider/queries/tree-sitter-languages/scala-tags.scm +65 -0
- aider/queries/tree-sitter-languages/typescript-tags.scm +41 -0
- aider/queries/tree-sitter-languages/zig-tags.scm +3 -0
- aider/reasoning_tags.py +82 -0
- aider/repo.py +621 -0
- aider/repomap.py +1174 -0
- aider/report.py +260 -0
- aider/resources/__init__.py +3 -0
- aider/resources/model-metadata.json +776 -0
- aider/resources/model-settings.yml +2068 -0
- aider/run_cmd.py +133 -0
- aider/scrape.py +293 -0
- aider/sendchat.py +242 -0
- aider/sessions.py +256 -0
- aider/special.py +203 -0
- aider/tools/__init__.py +72 -0
- aider/tools/command.py +105 -0
- aider/tools/command_interactive.py +122 -0
- aider/tools/delete_block.py +182 -0
- aider/tools/delete_line.py +155 -0
- aider/tools/delete_lines.py +184 -0
- aider/tools/extract_lines.py +341 -0
- aider/tools/finished.py +48 -0
- aider/tools/git_branch.py +129 -0
- aider/tools/git_diff.py +60 -0
- aider/tools/git_log.py +57 -0
- aider/tools/git_remote.py +53 -0
- aider/tools/git_show.py +51 -0
- aider/tools/git_status.py +46 -0
- aider/tools/grep.py +256 -0
- aider/tools/indent_lines.py +221 -0
- aider/tools/insert_block.py +288 -0
- aider/tools/list_changes.py +86 -0
- aider/tools/ls.py +93 -0
- aider/tools/make_editable.py +85 -0
- aider/tools/make_readonly.py +69 -0
- aider/tools/remove.py +91 -0
- aider/tools/replace_all.py +126 -0
- aider/tools/replace_line.py +173 -0
- aider/tools/replace_lines.py +217 -0
- aider/tools/replace_text.py +187 -0
- aider/tools/show_numbered_context.py +147 -0
- aider/tools/tool_utils.py +313 -0
- aider/tools/undo_change.py +95 -0
- aider/tools/update_todo_list.py +156 -0
- aider/tools/view.py +57 -0
- aider/tools/view_files_matching.py +141 -0
- aider/tools/view_files_with_symbol.py +129 -0
- aider/urls.py +17 -0
- aider/utils.py +456 -0
- aider/versioncheck.py +113 -0
- aider/voice.py +205 -0
- aider/waiting.py +38 -0
- aider/watch.py +318 -0
- aider/watch_prompts.py +12 -0
- aider/website/Gemfile +8 -0
- aider/website/_includes/blame.md +162 -0
- aider/website/_includes/get-started.md +22 -0
- aider/website/_includes/help-tip.md +5 -0
- aider/website/_includes/help.md +24 -0
- aider/website/_includes/install.md +5 -0
- aider/website/_includes/keys.md +4 -0
- aider/website/_includes/model-warnings.md +67 -0
- aider/website/_includes/multi-line.md +22 -0
- aider/website/_includes/python-m-aider.md +5 -0
- aider/website/_includes/recording.css +228 -0
- aider/website/_includes/recording.md +34 -0
- aider/website/_includes/replit-pipx.md +9 -0
- aider/website/_includes/works-best.md +1 -0
- aider/website/_sass/custom/custom.scss +103 -0
- aider/website/docs/config/adv-model-settings.md +2261 -0
- aider/website/docs/config/agent-mode.md +194 -0
- aider/website/docs/config/aider_conf.md +548 -0
- aider/website/docs/config/api-keys.md +90 -0
- aider/website/docs/config/dotenv.md +493 -0
- aider/website/docs/config/editor.md +127 -0
- aider/website/docs/config/mcp.md +95 -0
- aider/website/docs/config/model-aliases.md +104 -0
- aider/website/docs/config/options.md +890 -0
- aider/website/docs/config/reasoning.md +210 -0
- aider/website/docs/config.md +44 -0
- aider/website/docs/faq.md +384 -0
- aider/website/docs/git.md +76 -0
- aider/website/docs/index.md +47 -0
- aider/website/docs/install/codespaces.md +39 -0
- aider/website/docs/install/docker.md +57 -0
- aider/website/docs/install/optional.md +100 -0
- aider/website/docs/install/replit.md +8 -0
- aider/website/docs/install.md +115 -0
- aider/website/docs/languages.md +264 -0
- aider/website/docs/legal/contributor-agreement.md +111 -0
- aider/website/docs/legal/privacy.md +104 -0
- aider/website/docs/llms/anthropic.md +77 -0
- aider/website/docs/llms/azure.md +48 -0
- aider/website/docs/llms/bedrock.md +132 -0
- aider/website/docs/llms/cohere.md +34 -0
- aider/website/docs/llms/deepseek.md +32 -0
- aider/website/docs/llms/gemini.md +49 -0
- aider/website/docs/llms/github.md +111 -0
- aider/website/docs/llms/groq.md +36 -0
- aider/website/docs/llms/lm-studio.md +39 -0
- aider/website/docs/llms/ollama.md +75 -0
- aider/website/docs/llms/openai-compat.md +39 -0
- aider/website/docs/llms/openai.md +58 -0
- aider/website/docs/llms/openrouter.md +78 -0
- aider/website/docs/llms/other.md +117 -0
- aider/website/docs/llms/vertex.md +50 -0
- aider/website/docs/llms/warnings.md +10 -0
- aider/website/docs/llms/xai.md +53 -0
- aider/website/docs/llms.md +54 -0
- aider/website/docs/more/analytics.md +127 -0
- aider/website/docs/more/edit-formats.md +116 -0
- aider/website/docs/more/infinite-output.md +165 -0
- aider/website/docs/more-info.md +8 -0
- aider/website/docs/recordings/auto-accept-architect.md +31 -0
- aider/website/docs/recordings/dont-drop-original-read-files.md +35 -0
- aider/website/docs/recordings/index.md +21 -0
- aider/website/docs/recordings/model-accepts-settings.md +69 -0
- aider/website/docs/recordings/tree-sitter-language-pack.md +80 -0
- aider/website/docs/repomap.md +112 -0
- aider/website/docs/scripting.md +100 -0
- aider/website/docs/sessions.md +203 -0
- aider/website/docs/troubleshooting/aider-not-found.md +24 -0
- aider/website/docs/troubleshooting/edit-errors.md +76 -0
- aider/website/docs/troubleshooting/imports.md +62 -0
- aider/website/docs/troubleshooting/models-and-keys.md +54 -0
- aider/website/docs/troubleshooting/support.md +79 -0
- aider/website/docs/troubleshooting/token-limits.md +96 -0
- aider/website/docs/troubleshooting/warnings.md +12 -0
- aider/website/docs/troubleshooting.md +11 -0
- aider/website/docs/usage/browser.md +57 -0
- aider/website/docs/usage/caching.md +49 -0
- aider/website/docs/usage/commands.md +133 -0
- aider/website/docs/usage/conventions.md +119 -0
- aider/website/docs/usage/copypaste.md +121 -0
- aider/website/docs/usage/images-urls.md +48 -0
- aider/website/docs/usage/lint-test.md +118 -0
- aider/website/docs/usage/modes.md +211 -0
- aider/website/docs/usage/not-code.md +179 -0
- aider/website/docs/usage/notifications.md +87 -0
- aider/website/docs/usage/tips.md +79 -0
- aider/website/docs/usage/tutorials.md +30 -0
- aider/website/docs/usage/voice.md +121 -0
- aider/website/docs/usage/watch.md +294 -0
- aider/website/docs/usage.md +102 -0
- aider/website/share/index.md +101 -0
- aider_ce-0.88.20.dist-info/METADATA +187 -0
- aider_ce-0.88.20.dist-info/RECORD +279 -0
- aider_ce-0.88.20.dist-info/WHEEL +5 -0
- aider_ce-0.88.20.dist-info/entry_points.txt +2 -0
- aider_ce-0.88.20.dist-info/licenses/LICENSE.txt +202 -0
- aider_ce-0.88.20.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# flake8: noqa: E501
|
|
2
|
+
|
|
3
|
+
from .base_prompts import CoderPrompts
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AgentPrompts(CoderPrompts):
|
|
7
|
+
"""
|
|
8
|
+
Prompt templates for the Agent mode, which enables autonomous codebase exploration.
|
|
9
|
+
|
|
10
|
+
The AgentCoder uses these prompts to guide its behavior when exploring and modifying
|
|
11
|
+
a codebase using special tool commands like Glob, Grep, Add, etc. This mode enables the
|
|
12
|
+
LLM to manage its own context by adding/removing files and executing commands.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
main_system = r"""
|
|
16
|
+
<context name="role_and_directives">
|
|
17
|
+
## Core Directives
|
|
18
|
+
- **Role**: Act as an expert software engineer.
|
|
19
|
+
- **Act Proactively**: Autonomously use file discovery and context management tools (`ViewFilesAtGlob`, `ViewFilesMatching`, `Ls`, `View`, `Remove`) to gather information and fulfill the user's request. Chain tool calls across multiple turns to continue exploration.
|
|
20
|
+
- **Be Decisive**: Do not ask the same question or search for the same term in multiple ways. Trust your initial valid findings.
|
|
21
|
+
- **Be Concise**: Keep all responses brief and direct (1-3 sentences). Avoid preamble, postamble, and unnecessary explanations.
|
|
22
|
+
- **Confirm Ambiguity**: Before applying complex or ambiguous edits, briefly state your plan and ask for confirmation. For simple, direct edits, proceed without confirmation.
|
|
23
|
+
</context>
|
|
24
|
+
|
|
25
|
+
<context name="workflow_and_tool_usage">
|
|
26
|
+
## Core Workflow
|
|
27
|
+
1. **Plan**: Determine the necessary changes. Use the `UpdateTodoList` tool to manage your plan. Always begin by the todo list.
|
|
28
|
+
2. **Explore**: Use discovery tools (`ViewFilesAtGlob`, `ViewFilesMatching`, `Ls`, `Grep`) to find relevant files. These tools add files to context as read-only. Use `Grep` first for broad searches to avoid context clutter.
|
|
29
|
+
3. **Think**: Given the contents of your exploration, reason through the edits that need to be made to accomplish the goal. For complex edits, briefly outline your plan for the user.
|
|
30
|
+
4. **Execute**: Use the appropriate editing tool. Remember to use `MakeEditable` on a file before modifying it. Break large edits (those greater than 100 lines) into multiple steps
|
|
31
|
+
5. **Verify & Recover**: After every edit, check the resulting diff snippet. If an edit is incorrect, **immediately** use `UndoChange` in your very next message before attempting any other action.
|
|
32
|
+
6. **Finished**: Use the `Finished` tool when all tasks and changes needed to accomplish the goal are finished
|
|
33
|
+
|
|
34
|
+
## Todo List Management
|
|
35
|
+
- **Track Progress**: Use the `UpdateTodoList` tool to add or modify items.
|
|
36
|
+
- **Plan Steps**: Create a todo list at the start of complex tasks to track your progress through multiple exploration rounds.
|
|
37
|
+
- **Stay Organized**: Update the todo list as you complete steps every 3-10 tool calls to maintain context across multiple tool calls.
|
|
38
|
+
|
|
39
|
+
## Code Editing Hierarchy
|
|
40
|
+
Your primary method for all modifications is through granular tool calls. Use SEARCH/REPLACE only as a last resort.
|
|
41
|
+
|
|
42
|
+
### 1. Granular Tools (Always Preferred)
|
|
43
|
+
Use these for precision and safety.
|
|
44
|
+
- **Text/Block Manipulation**: `ReplaceText` (Preferred for the majority of edits), `InsertBlock`, `DeleteBlock`, `ReplaceAll` (use with `dry_run=True` for safety).
|
|
45
|
+
- **Line-Based Edits**: `ReplaceLine(s)`, `DeleteLine(s)`, `IndentLines`.
|
|
46
|
+
- **Refactoring & History**: `ExtractLines`, `ListChanges`, `UndoChange`.
|
|
47
|
+
|
|
48
|
+
**MANDATORY Safety Protocol for Line-Based Tools:** Line numbers are fragile. You **MUST** use a two-turn process:
|
|
49
|
+
1. **Turn 1**: Use `ShowNumberedContext` to get the exact, current line numbers.
|
|
50
|
+
2. **Turn 2**: In your *next* message, use the line-based editing tool (`ReplaceLines`, etc.) with the verified numbers.
|
|
51
|
+
|
|
52
|
+
### 2. SEARCH/REPLACE (Last Resort Only)
|
|
53
|
+
Use this format **only** when granular tools are demonstrably insufficient for the task (e.g., a complex, non-contiguous pattern change). Using SEARCH/REPLACE for tasks achievable by tools like `ReplaceLines` is a violation of your instructions.
|
|
54
|
+
|
|
55
|
+
**You MUST include a justification comment explaining why granular tools cannot be used.**
|
|
56
|
+
|
|
57
|
+
Justification: I'm using SEARCH/REPLACE because [specific reason granular tools are insufficient].
|
|
58
|
+
path/to/file.ext <<<<<<< SEARCH Original code to be replaced.
|
|
59
|
+
New code to insert.
|
|
60
|
+
|
|
61
|
+
REPLACE
|
|
62
|
+
|
|
63
|
+
</context>
|
|
64
|
+
|
|
65
|
+
Always reply to the user in {language}.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
files_content_assistant_reply = "I understand. I'll use these files to help with your request."
|
|
69
|
+
|
|
70
|
+
files_no_full_files = (
|
|
71
|
+
"<context name=\"file_status\">I don't have full contents of any files yet. I'll add them"
|
|
72
|
+
" as needed using the tool commands.</context>"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
files_no_full_files_with_repo_map = """<context name="repo_map_status">
|
|
76
|
+
I have a repository map but no full file contents yet. I will use my navigation tools to add relevant files to the context.
|
|
77
|
+
</context>
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
files_no_full_files_with_repo_map_reply = """I understand. I'll use the repository map and navigation tools to find and add files as needed.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
repo_content_prefix = """<context name="repo_map">
|
|
84
|
+
I am working with code in a git repository. Here are summaries of some files:
|
|
85
|
+
</context>
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
system_reminder = """
|
|
89
|
+
<context name="critical_reminders">
|
|
90
|
+
## Reminders
|
|
91
|
+
- Any tool call automatically continues to the next turn. Provide no tool calls in your final answer.
|
|
92
|
+
- Prioritize granular tools. Using SEARCH/REPLACE unnecessarily is incorrect.
|
|
93
|
+
- For SEARCH/REPLACE, you MUST provide a justification.
|
|
94
|
+
- Use context blocks (directory structure, git status) to orient yourself.
|
|
95
|
+
|
|
96
|
+
{lazy_prompt}
|
|
97
|
+
{shell_cmd_reminder}
|
|
98
|
+
</context>
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
try_again = """I need to retry my exploration. My previous attempt may have missed relevant files or used incorrect search patterns.
|
|
102
|
+
|
|
103
|
+
I will now explore more strategically with more specific patterns and better context management. I will chain tool calls to continue until I have sufficient information.
|
|
104
|
+
"""
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from .architect_prompts import ArchitectPrompts
|
|
2
|
+
from .ask_coder import AskCoder
|
|
3
|
+
from .base_coder import Coder
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ArchitectCoder(AskCoder):
|
|
7
|
+
edit_format = "architect"
|
|
8
|
+
gpt_prompts = ArchitectPrompts()
|
|
9
|
+
auto_accept_architect = False
|
|
10
|
+
|
|
11
|
+
async def reply_completed(self):
|
|
12
|
+
content = self.partial_response_content
|
|
13
|
+
|
|
14
|
+
if not content or not content.strip():
|
|
15
|
+
return
|
|
16
|
+
|
|
17
|
+
if not self.auto_accept_architect and not await self.io.confirm_ask("Edit the files?"):
|
|
18
|
+
return
|
|
19
|
+
|
|
20
|
+
kwargs = dict()
|
|
21
|
+
|
|
22
|
+
# Use the editor_model from the main_model if it exists, otherwise use the main_model itself
|
|
23
|
+
editor_model = self.main_model.editor_model or self.main_model
|
|
24
|
+
|
|
25
|
+
kwargs["main_model"] = editor_model
|
|
26
|
+
kwargs["edit_format"] = self.main_model.editor_edit_format
|
|
27
|
+
kwargs["suggest_shell_commands"] = False
|
|
28
|
+
kwargs["map_tokens"] = 0
|
|
29
|
+
kwargs["total_cost"] = self.total_cost
|
|
30
|
+
kwargs["cache_prompts"] = False
|
|
31
|
+
kwargs["num_cache_warming_pings"] = 0
|
|
32
|
+
kwargs["summarize_from_coder"] = False
|
|
33
|
+
|
|
34
|
+
new_kwargs = dict(io=self.io, from_coder=self)
|
|
35
|
+
new_kwargs.update(kwargs)
|
|
36
|
+
|
|
37
|
+
editor_coder = await Coder.create(**new_kwargs)
|
|
38
|
+
editor_coder.cur_messages = []
|
|
39
|
+
editor_coder.done_messages = []
|
|
40
|
+
|
|
41
|
+
if self.verbose:
|
|
42
|
+
editor_coder.show_announcements()
|
|
43
|
+
|
|
44
|
+
await editor_coder.run(with_message=content, preproc=False)
|
|
45
|
+
|
|
46
|
+
self.move_back_cur_messages("I made those changes to the files.")
|
|
47
|
+
self.total_cost = editor_coder.total_cost
|
|
48
|
+
self.aider_commit_hashes = editor_coder.aider_commit_hashes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# flake8: noqa: E501
|
|
2
|
+
|
|
3
|
+
from .base_prompts import CoderPrompts
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ArchitectPrompts(CoderPrompts):
|
|
7
|
+
main_system = """Act as an expert architect engineer providing direction to an editor engineer.
|
|
8
|
+
Deeply understand the user's change request and the provided code context.
|
|
9
|
+
Think step-by-step to develop a clear plan for the required code modifications.
|
|
10
|
+
Consider potential edge cases and how the changes should be verified.
|
|
11
|
+
Describe the plan and the necessary modifications to the editor engineer. Your instructions must be unambiguous, complete, and concise as the editor will rely solely on them.
|
|
12
|
+
Focus on *what* needs to change and *why*.
|
|
13
|
+
|
|
14
|
+
DO NOT show large blocks of code or the entire updated file content. Explain the changes conceptually.
|
|
15
|
+
|
|
16
|
+
Always reply to the user in {language}.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
example_messages = []
|
|
20
|
+
|
|
21
|
+
files_content_prefix = """I have *added these files to the chat* so you see all of their contents.
|
|
22
|
+
*Trust this message as the true contents of the files!*
|
|
23
|
+
Other messages in the chat may contain outdated versions of the files' contents.
|
|
24
|
+
""" # noqa: E501
|
|
25
|
+
|
|
26
|
+
files_content_assistant_reply = (
|
|
27
|
+
"Ok, I will use that as the true, current contents of the files."
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
files_no_full_files = "I am not sharing the full contents of any files with you yet."
|
|
31
|
+
|
|
32
|
+
files_no_full_files_with_repo_map = ""
|
|
33
|
+
files_no_full_files_with_repo_map_reply = ""
|
|
34
|
+
|
|
35
|
+
repo_content_prefix = """I am working with you on code in a git repository.
|
|
36
|
+
Here are summaries of some files present in my git repo.
|
|
37
|
+
If you need to see the full contents of any files to answer my questions, ask me to *add them to the chat*.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
system_reminder = ""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# flake8: noqa: E501
|
|
2
|
+
|
|
3
|
+
from .base_prompts import CoderPrompts
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AskPrompts(CoderPrompts):
|
|
7
|
+
main_system = """Act as an expert code analyst.
|
|
8
|
+
Answer questions about the supplied code.
|
|
9
|
+
Always reply to the user in {language}.
|
|
10
|
+
|
|
11
|
+
If you need to describe code changes, do so *briefly*.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
example_messages = []
|
|
15
|
+
|
|
16
|
+
files_content_prefix = """I have *added these files to the chat* so you see all of their contents.
|
|
17
|
+
*Trust this message as the true contents of the files!*
|
|
18
|
+
Other messages in the chat may contain outdated versions of the files' contents.
|
|
19
|
+
""" # noqa: E501
|
|
20
|
+
|
|
21
|
+
files_content_assistant_reply = (
|
|
22
|
+
"Ok, I will use that as the true, current contents of the files."
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
files_no_full_files = "I am not sharing the full contents of any files with you yet."
|
|
26
|
+
|
|
27
|
+
files_no_full_files_with_repo_map = ""
|
|
28
|
+
files_no_full_files_with_repo_map_reply = ""
|
|
29
|
+
|
|
30
|
+
repo_content_prefix = """I am working with you on code in a git repository.
|
|
31
|
+
Here are summaries of some files present in my git repo.
|
|
32
|
+
If you need to see the full contents of any files to answer my questions, ask me to *add them to the chat*.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
system_reminder = "{final_reminders}"
|