mirror of
https://github.com/Aider-AI/aider
synced 2026-05-05 06:32:04 +02:00
Compare commits
96 Commits
v0.55.1.de
...
v0.56.1.de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
509c880b68 | ||
|
|
6f2b064f53 | ||
|
|
26c2b2e3ed | ||
|
|
3976d4b8f1 | ||
|
|
964fe7e2dc | ||
|
|
eced076602 | ||
|
|
bd21122e64 | ||
|
|
00f42590c8 | ||
|
|
4e63254704 | ||
|
|
3cd6790d9a | ||
|
|
d82d21b8c1 | ||
|
|
1a6284cb24 | ||
|
|
abf6a9db2e | ||
|
|
73e7d7bd2a | ||
|
|
82f8aa5d6a | ||
|
|
cee348614e | ||
|
|
e40a07a8a1 | ||
|
|
99dc235a00 | ||
|
|
9982f439e4 | ||
|
|
1e9ff842f3 | ||
|
|
aeea629d17 | ||
|
|
b4389f98fb | ||
|
|
f54b6860db | ||
|
|
ed7a9c6562 | ||
|
|
ab35e473f3 | ||
|
|
e526d2890c | ||
|
|
2eae3738ff | ||
|
|
f98b64dd98 | ||
|
|
d2379a6d73 | ||
|
|
84758c6c8d | ||
|
|
304566a914 | ||
|
|
e9c0c82e03 | ||
|
|
2aef59e624 | ||
|
|
74631eec98 | ||
|
|
3a36edb8ec | ||
|
|
795810ffb8 | ||
|
|
2663233b60 | ||
|
|
8d151a3573 | ||
|
|
1c73e7d43a | ||
|
|
8cfdcbd976 | ||
|
|
45855bd96c | ||
|
|
b57468a963 | ||
|
|
34099408a5 | ||
|
|
781996fe84 | ||
|
|
3d73fac84c | ||
|
|
2bcc9a54a9 | ||
|
|
e4cbbb1fa8 | ||
|
|
a35c532211 | ||
|
|
c2b8522e9a | ||
|
|
5123d8c5de | ||
|
|
9b924237b7 | ||
|
|
c04453d282 | ||
|
|
f02da16353 | ||
|
|
6c739d391b | ||
|
|
e3cd9a8f9a | ||
|
|
76bc0e11b8 | ||
|
|
485d5487af | ||
|
|
246ce318d2 | ||
|
|
6e3d8d90de | ||
|
|
2d866418da | ||
|
|
ff15bcdb30 | ||
|
|
e799ada6f5 | ||
|
|
7c5cad74ab | ||
|
|
41e8f4401e | ||
|
|
e271941aa2 | ||
|
|
6152a82513 | ||
|
|
937a1cd847 | ||
|
|
867d19952c | ||
|
|
7c5d999032 | ||
|
|
6d23b22e6f | ||
|
|
168598dad4 | ||
|
|
bd7ff9cca4 | ||
|
|
51f360ab9f | ||
|
|
66ae9ae079 | ||
|
|
65fd6b444c | ||
|
|
15abe6b921 | ||
|
|
d8027030b0 | ||
|
|
edd9b44ad3 | ||
|
|
14fc3e3ad1 | ||
|
|
cd551dbf63 | ||
|
|
ed349b65b5 | ||
|
|
bb5bca5227 | ||
|
|
e98645698b | ||
|
|
376e8617f3 | ||
|
|
a3d585a4b4 | ||
|
|
5853c7fa92 | ||
|
|
18bf3a9f36 | ||
|
|
e7253d819e | ||
|
|
75c27a5dfb | ||
|
|
7598f883f5 | ||
|
|
1b5ef76c18 | ||
|
|
70994cfc5b | ||
|
|
c5ac621da1 | ||
|
|
5c6d4dbbf1 | ||
|
|
9434f99458 | ||
|
|
9988a3ff79 |
@@ -20,7 +20,7 @@ See the
|
||||
[benchmark README](https://github.com/paul-gauthier/aider/blob/main/benchmark/README.md)
|
||||
for information on running aider's code editing benchmarks.
|
||||
Submit results by opening a PR with edits to the
|
||||
[benchmark results data files](https://github.com/paul-gauthier/aider/blob/main/_data/).
|
||||
[benchmark results data files](https://github.com/paul-gauthier/aider/blob/main/aider/website/_data/).
|
||||
|
||||
|
||||
## Pull Requests
|
||||
|
||||
11
HISTORY.md
11
HISTORY.md
@@ -1,6 +1,17 @@
|
||||
|
||||
# Release history
|
||||
|
||||
### main branch
|
||||
|
||||
- New `/report` command to open your browser with a pre-populated GitHub Issue.
|
||||
- New `--chat-language` switch to set the spoken language.
|
||||
- Now `--[no-]suggest-shell-commands` controls both prompting for and offering to execute shell commands.
|
||||
- DeepSeek models use 8192 output tokens.
|
||||
- Check key imports on launch, provide helpful error message if dependencies aren't available.
|
||||
- Renamed `--models` to `--list-models`.
|
||||
- Numerous bug fixes for corner case crashes.
|
||||
- Aider wrote 56% of the code in this release.
|
||||
|
||||
### Aider v0.55.0
|
||||
|
||||
- Only print the pip command when self updating on Windows, without running it.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
try:
|
||||
from aider.__version__ import __version__
|
||||
except Exception:
|
||||
__version__ = "0.55.1.dev"
|
||||
__version__ = "0.56.1.dev"
|
||||
|
||||
__all__ = [__version__]
|
||||
|
||||
@@ -121,6 +121,7 @@ def get_parser(default_config_files, git_root):
|
||||
##########
|
||||
group = parser.add_argument_group("Model Settings")
|
||||
group.add_argument(
|
||||
"--list-models",
|
||||
"--models",
|
||||
metavar="MODEL",
|
||||
help="List known models which match the (partial) MODEL name",
|
||||
@@ -490,6 +491,12 @@ def get_parser(default_config_files, git_root):
|
||||
default="en",
|
||||
help="Specify the language for voice using ISO 639-1 code (default: auto)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--chat-language",
|
||||
metavar="CHAT_LANGUAGE",
|
||||
default=None,
|
||||
help="Specify the language to use in the chat (default: None, uses system settings)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--version",
|
||||
action="version",
|
||||
|
||||
@@ -93,6 +93,7 @@ class Coder:
|
||||
num_cache_warming_pings = 0
|
||||
suggest_shell_commands = True
|
||||
ignore_mentions = None
|
||||
chat_language = None
|
||||
|
||||
@classmethod
|
||||
def create(
|
||||
@@ -159,7 +160,9 @@ class Coder:
|
||||
raise ValueError(f"Unknown edit format {edit_format}")
|
||||
|
||||
def clone(self, **kwargs):
|
||||
return Coder.create(from_coder=self, **kwargs)
|
||||
new_coder = Coder.create(from_coder=self, **kwargs)
|
||||
new_coder.ignore_mentions = self.ignore_mentions
|
||||
return new_coder
|
||||
|
||||
def get_announcements(self):
|
||||
lines = []
|
||||
@@ -258,7 +261,9 @@ class Coder:
|
||||
cache_prompts=False,
|
||||
num_cache_warming_pings=0,
|
||||
suggest_shell_commands=True,
|
||||
chat_language=None,
|
||||
):
|
||||
self.chat_language = chat_language
|
||||
self.commit_before_message = []
|
||||
self.aider_commit_hashes = set()
|
||||
self.rejected_urls = set()
|
||||
@@ -854,6 +859,9 @@ class Coder:
|
||||
self.cur_messages = []
|
||||
|
||||
def get_user_language(self):
|
||||
if self.chat_language:
|
||||
return self.chat_language
|
||||
|
||||
try:
|
||||
lang = locale.getlocale()[0]
|
||||
if lang:
|
||||
@@ -915,10 +923,21 @@ class Coder:
|
||||
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
|
||||
platform_text = self.get_platform_info()
|
||||
|
||||
if self.suggest_shell_commands:
|
||||
shell_cmd_prompt = self.gpt_prompts.shell_cmd_prompt.format(platform=platform_text)
|
||||
shell_cmd_reminder = self.gpt_prompts.shell_cmd_reminder.format(platform=platform_text)
|
||||
else:
|
||||
shell_cmd_prompt = self.gpt_prompts.no_shell_cmd_prompt.format(platform=platform_text)
|
||||
shell_cmd_reminder = self.gpt_prompts.no_shell_cmd_reminder.format(
|
||||
platform=platform_text
|
||||
)
|
||||
|
||||
prompt = prompt.format(
|
||||
fence=self.fence,
|
||||
lazy_prompt=lazy_prompt,
|
||||
platform=platform_text,
|
||||
shell_cmd_prompt=shell_cmd_prompt,
|
||||
shell_cmd_reminder=shell_cmd_reminder,
|
||||
)
|
||||
return prompt
|
||||
|
||||
@@ -1624,7 +1643,10 @@ class Coder:
|
||||
return cur + new
|
||||
|
||||
def get_rel_fname(self, fname):
|
||||
return os.path.relpath(fname, self.root)
|
||||
try:
|
||||
return os.path.relpath(fname, self.root)
|
||||
except ValueError:
|
||||
return fname
|
||||
|
||||
def get_inchat_relative_files(self):
|
||||
files = [self.get_rel_fname(fname) for fname in self.abs_fnames]
|
||||
|
||||
@@ -43,3 +43,8 @@ If you need to edit any of these files, ask me to *add them to the chat* first.
|
||||
read_only_files_prefix = """Here are some READ ONLY files, provided for your reference.
|
||||
Do not edit these files!
|
||||
"""
|
||||
|
||||
shell_cmd_prompt = ""
|
||||
shell_cmd_reminder = ""
|
||||
no_shell_cmd_prompt = ""
|
||||
no_shell_cmd_reminder = ""
|
||||
|
||||
@@ -27,7 +27,10 @@ You can keep asking if you then decide you need to edit more files.
|
||||
|
||||
All changes to files must use this *SEARCH/REPLACE block* format.
|
||||
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
{shell_cmd_prompt}
|
||||
"""
|
||||
|
||||
shell_cmd_prompt = """
|
||||
4. *Concisely* suggest any shell commands the user might want to run in ```bash blocks.
|
||||
|
||||
Just suggest shell commands this way, not example code.
|
||||
@@ -36,7 +39,6 @@ Only suggest at most a few shell commands at a time, not more than 1-3.
|
||||
|
||||
Use the appropriate shell based on the user's system info:
|
||||
{platform}
|
||||
|
||||
Examples of when to suggest shell commands:
|
||||
|
||||
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
|
||||
@@ -47,6 +49,10 @@ Examples of when to suggest shell commands:
|
||||
- Etc.
|
||||
"""
|
||||
|
||||
no_shell_cmd_prompt = """
|
||||
Keep in mind these details about the user's platform and environment:
|
||||
{platform}
|
||||
"""
|
||||
example_messages = [
|
||||
dict(
|
||||
role="user",
|
||||
@@ -176,7 +182,10 @@ To rename files which have been added to the chat, use shell commands at the end
|
||||
|
||||
{lazy_prompt}
|
||||
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
|
||||
{shell_cmd_reminder}
|
||||
"""
|
||||
|
||||
shell_cmd_reminder = """
|
||||
Examples of when to suggest shell commands:
|
||||
|
||||
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
|
||||
|
||||
@@ -1135,6 +1135,20 @@ class Commands:
|
||||
settings = format_settings(self.parser, self.args)
|
||||
self.io.tool_output(settings)
|
||||
|
||||
def cmd_report(self, args):
|
||||
"Report a problem by opening a GitHub Issue"
|
||||
from aider.report import report_github_issue
|
||||
|
||||
announcements = "\n".join(self.coder.get_announcements())
|
||||
issue_text = announcements
|
||||
|
||||
if args.strip():
|
||||
title = args.strip()
|
||||
else:
|
||||
title = None
|
||||
|
||||
report_github_issue(issue_text, title=title, confirm=False)
|
||||
|
||||
|
||||
def expand_subdir(file_path):
|
||||
if file_path.is_file():
|
||||
|
||||
@@ -345,7 +345,11 @@ class InputOutput:
|
||||
session = PromptSession(
|
||||
key_bindings=kb, editing_mode=self.editingmode, **session_kwargs
|
||||
)
|
||||
line = session.prompt()
|
||||
try:
|
||||
line = session.prompt()
|
||||
except UnicodeEncodeError as err:
|
||||
self.io.tool_error(str(err))
|
||||
return ""
|
||||
|
||||
if line and line[0] == "{" and not multiline_input:
|
||||
multiline_input = True
|
||||
|
||||
@@ -35,7 +35,10 @@ class Linter:
|
||||
|
||||
def get_rel_fname(self, fname):
|
||||
if self.root:
|
||||
return os.path.relpath(fname, self.root)
|
||||
try:
|
||||
return os.path.relpath(fname, self.root)
|
||||
except ValueError:
|
||||
return fname
|
||||
else:
|
||||
return fname
|
||||
|
||||
@@ -43,14 +46,18 @@ class Linter:
|
||||
cmd += " " + rel_fname
|
||||
cmd = cmd.split()
|
||||
|
||||
process = subprocess.Popen(
|
||||
cmd,
|
||||
cwd=self.root,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
encoding=self.encoding,
|
||||
errors="replace",
|
||||
)
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
cmd,
|
||||
cwd=self.root,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
encoding=self.encoding,
|
||||
errors="replace",
|
||||
)
|
||||
except OSError as err:
|
||||
print(f"Unable to execute lint command: {err}")
|
||||
return
|
||||
stdout, _ = process.communicate()
|
||||
errors = stdout
|
||||
if process.returncode == 0:
|
||||
@@ -202,7 +209,12 @@ def basic_lint(fname, code):
|
||||
if lang == "typescript":
|
||||
return
|
||||
|
||||
parser = get_parser(lang)
|
||||
try:
|
||||
parser = get_parser(lang)
|
||||
except OSError as err:
|
||||
print(f"Unable to load parser: {err}")
|
||||
return
|
||||
|
||||
tree = parser.parse(bytes(code, "utf-8"))
|
||||
|
||||
errors = traverse_tree(tree.root_node)
|
||||
|
||||
109
aider/main.py
109
aider/main.py
@@ -1,8 +1,10 @@
|
||||
import configparser
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import threading
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
|
||||
import git
|
||||
@@ -89,7 +91,7 @@ def setup_git(git_root, io):
|
||||
pass
|
||||
try:
|
||||
user_email = config.get_value("user", "email", None)
|
||||
except configparser.NoSectionError:
|
||||
except (configparser.NoSectionError, configparser.NoOptionError):
|
||||
pass
|
||||
|
||||
if user_name and user_email:
|
||||
@@ -300,23 +302,27 @@ def sanity_check_repo(repo, io):
|
||||
|
||||
try:
|
||||
repo.get_tracked_files()
|
||||
return True
|
||||
if not repo.git_repo_error:
|
||||
return True
|
||||
error_msg = str(repo.git_repo_error)
|
||||
except ANY_GIT_ERROR as exc:
|
||||
error_msg = str(exc)
|
||||
bad_ver = "version in (1, 2)" in error_msg
|
||||
except AssertionError as exc:
|
||||
error_msg = str(exc)
|
||||
bad_ver = True
|
||||
|
||||
if "version in (1, 2)" in error_msg:
|
||||
io.tool_error("Aider only works with git repos with version number 1 or 2.")
|
||||
io.tool_output(
|
||||
"You may be able to convert your repo: git update-index --index-version=2"
|
||||
)
|
||||
io.tool_output("Or run aider --no-git to proceed without using git.")
|
||||
io.tool_output("https://github.com/paul-gauthier/aider/issues/211")
|
||||
return False
|
||||
|
||||
io.tool_error("Unable to read git repository, it may be corrupt?")
|
||||
io.tool_output(error_msg)
|
||||
if bad_ver:
|
||||
io.tool_error("Aider only works with git repos with version number 1 or 2.")
|
||||
io.tool_output("You may be able to convert your repo: git update-index --index-version=2")
|
||||
io.tool_output("Or run aider --no-git to proceed without using git.")
|
||||
io.tool_output("https://github.com/paul-gauthier/aider/issues/211")
|
||||
return False
|
||||
|
||||
io.tool_error("Unable to read git repository, it may be corrupt?")
|
||||
io.tool_output(error_msg)
|
||||
return False
|
||||
|
||||
|
||||
def main(argv=None, input=None, output=None, force_git_root=None, return_coder=False):
|
||||
report_uncaught_exceptions()
|
||||
@@ -468,8 +474,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
if args.check_update:
|
||||
check_version(io, verbose=args.verbose)
|
||||
|
||||
if args.models:
|
||||
models.print_matching_models(io, args.models)
|
||||
if args.list_models:
|
||||
models.print_matching_models(io, args.list_models)
|
||||
return 0
|
||||
|
||||
if args.git:
|
||||
@@ -485,6 +491,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
cmd_line = scrub_sensitive_info(args, cmd_line)
|
||||
io.tool_output(cmd_line, log_only=True)
|
||||
|
||||
check_and_load_imports(io, verbose=args.verbose)
|
||||
|
||||
if args.anthropic_api_key:
|
||||
os.environ["ANTHROPIC_API_KEY"] = args.anthropic_api_key
|
||||
|
||||
@@ -511,8 +519,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
|
||||
if args.verbose:
|
||||
io.tool_output("Model info:")
|
||||
for key, value in main_model.info.items():
|
||||
io.tool_output(f" {key}: {value}")
|
||||
io.tool_output(json.dumps(main_model.info, indent=4))
|
||||
|
||||
lint_cmds = parse_lint_cmds(args.lint_cmd, io)
|
||||
if lint_cmds is None:
|
||||
@@ -593,6 +600,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
map_mul_no_files=args.map_multiplier_no_files,
|
||||
num_cache_warming_pings=args.cache_keepalive_pings,
|
||||
suggest_shell_commands=args.suggest_shell_commands,
|
||||
chat_language=args.chat_language,
|
||||
)
|
||||
except ValueError as err:
|
||||
io.tool_error(str(err))
|
||||
@@ -685,10 +693,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
if args.exit:
|
||||
return
|
||||
|
||||
thread = threading.Thread(target=load_slow_imports)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
coder.run()
|
||||
@@ -705,19 +709,72 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||
coder.show_announcements()
|
||||
|
||||
|
||||
def load_slow_imports():
|
||||
def check_and_load_imports(io, verbose=False):
|
||||
installs_file = Path.home() / ".aider" / "installs.json"
|
||||
key = (__version__, sys.executable)
|
||||
|
||||
if verbose:
|
||||
io.tool_output(
|
||||
f"Checking imports for version {__version__} and executable {sys.executable}"
|
||||
)
|
||||
io.tool_output(f"Installs file: {installs_file}")
|
||||
|
||||
try:
|
||||
if installs_file.exists():
|
||||
with open(installs_file, "r") as f:
|
||||
installs = json.load(f)
|
||||
if verbose:
|
||||
io.tool_output("Installs file exists and loaded")
|
||||
else:
|
||||
installs = {}
|
||||
if verbose:
|
||||
io.tool_output("Installs file does not exist, creating new dictionary")
|
||||
|
||||
if str(key) not in installs:
|
||||
if verbose:
|
||||
io.tool_output(
|
||||
"First run for this version and executable, loading imports synchronously"
|
||||
)
|
||||
try:
|
||||
load_slow_imports(swallow=False)
|
||||
except Exception as err:
|
||||
io.tool_error(str(err))
|
||||
io.tool_output("Error loading required imports. Did you install aider properly?")
|
||||
io.tool_output("https://aider.chat/docs/install/install.html")
|
||||
sys.exit(1)
|
||||
|
||||
installs[str(key)] = True
|
||||
installs_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(installs_file, "w") as f:
|
||||
json.dump(installs, f, indent=4)
|
||||
if verbose:
|
||||
io.tool_output("Imports loaded and installs file updated")
|
||||
else:
|
||||
if verbose:
|
||||
io.tool_output("Not first run, loading imports in background thread")
|
||||
thread = threading.Thread(target=load_slow_imports)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
except Exception as e:
|
||||
io.tool_warning(f"Error in checking imports: {e}")
|
||||
if verbose:
|
||||
io.tool_output(f"Full exception details: {traceback.format_exc()}")
|
||||
|
||||
|
||||
def load_slow_imports(swallow=True):
|
||||
# These imports are deferred in various ways to
|
||||
# improve startup time.
|
||||
# This func is called in a thread to load them in the background
|
||||
# while we wait for the user to type their first message.
|
||||
# This func is called either synchronously or in a thread
|
||||
# depending on whether it's been run before for this version and executable.
|
||||
|
||||
try:
|
||||
import httpx # noqa: F401
|
||||
import litellm # noqa: F401
|
||||
import networkx # noqa: F401
|
||||
import numpy # noqa: F401
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as e:
|
||||
if not swallow:
|
||||
raise e
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -18,7 +18,7 @@ from aider.dump import dump # noqa: F401
|
||||
from aider.llm import litellm
|
||||
|
||||
DEFAULT_MODEL_NAME = "gpt-4o"
|
||||
ANTHROPIC_BETA_HEADER = "max-tokens-3-5-sonnet-2024-07-15,prompt-caching-2024-07-31"
|
||||
ANTHROPIC_BETA_HEADER = "prompt-caching-2024-07-31"
|
||||
|
||||
OPENAI_MODELS = """
|
||||
gpt-4
|
||||
@@ -306,10 +306,8 @@ MODEL_SETTINGS = [
|
||||
examples_as_sys_msg=True,
|
||||
accepts_images=True,
|
||||
max_tokens=8192,
|
||||
extra_headers={
|
||||
"anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15",
|
||||
},
|
||||
reminder="user",
|
||||
cache_control=True,
|
||||
),
|
||||
# Vertex AI Claude models
|
||||
# Does not yet support 8k token
|
||||
@@ -320,6 +318,7 @@ MODEL_SETTINGS = [
|
||||
use_repo_map=True,
|
||||
examples_as_sys_msg=True,
|
||||
accepts_images=True,
|
||||
max_tokens=8192,
|
||||
reminder="user",
|
||||
),
|
||||
ModelSettings(
|
||||
@@ -386,6 +385,7 @@ MODEL_SETTINGS = [
|
||||
use_repo_map=True,
|
||||
examples_as_sys_msg=True,
|
||||
reminder="sys",
|
||||
max_tokens=8192,
|
||||
),
|
||||
ModelSettings(
|
||||
"deepseek/deepseek-coder",
|
||||
@@ -394,6 +394,7 @@ MODEL_SETTINGS = [
|
||||
examples_as_sys_msg=True,
|
||||
reminder="sys",
|
||||
caches_by_default=True,
|
||||
max_tokens=8192,
|
||||
),
|
||||
ModelSettings(
|
||||
"openrouter/deepseek/deepseek-coder",
|
||||
|
||||
@@ -10,7 +10,7 @@ from aider.sendchat import simple_send_with_retries
|
||||
|
||||
from .dump import dump # noqa: F401
|
||||
|
||||
ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError)
|
||||
ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError, OSError, IndexError)
|
||||
|
||||
|
||||
class GitRepo:
|
||||
@@ -21,6 +21,7 @@ class GitRepo:
|
||||
aider_ignore_last_check = 0
|
||||
subtree_only = False
|
||||
ignore_file_cache = {}
|
||||
git_repo_error = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@@ -257,15 +258,26 @@ class GitRepo:
|
||||
commit = self.repo.head.commit
|
||||
except ValueError:
|
||||
commit = None
|
||||
except ANY_GIT_ERROR as err:
|
||||
self.git_repo_error = err
|
||||
self.io.tool_error(f"Unable to list files in git repo: {err}")
|
||||
self.io.tool_output("Is your git repo corrupted?")
|
||||
return []
|
||||
|
||||
files = set()
|
||||
if commit:
|
||||
if commit in self.tree_files:
|
||||
files = self.tree_files[commit]
|
||||
else:
|
||||
for blob in commit.tree.traverse():
|
||||
if blob.type == "blob": # blob is a file
|
||||
files.add(blob.path)
|
||||
try:
|
||||
for blob in commit.tree.traverse():
|
||||
if blob.type == "blob": # blob is a file
|
||||
files.add(blob.path)
|
||||
except ANY_GIT_ERROR as err:
|
||||
self.git_repo_error = err
|
||||
self.io.tool_error(f"Unable to list files in git repo: {err}")
|
||||
self.io.tool_output("Is your git repo corrupted?")
|
||||
return []
|
||||
files = set(self.normalize_path(path) for path in files)
|
||||
self.tree_files[commit] = set(files)
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ from tree_sitter_languages import get_language, get_parser # noqa: E402
|
||||
Tag = namedtuple("Tag", "rel_fname fname line name kind".split())
|
||||
|
||||
|
||||
SQLITE_ERRORS = (sqlite3.OperationalError, sqlite3.DatabaseError)
|
||||
|
||||
|
||||
class RepoMap:
|
||||
CACHE_VERSION = 3
|
||||
TAGS_CACHE_DIR = f".aider.tags.cache.v{CACHE_VERSION}"
|
||||
@@ -167,7 +170,7 @@ class RepoMap:
|
||||
path = Path(self.root) / self.TAGS_CACHE_DIR
|
||||
try:
|
||||
self.TAGS_CACHE = Cache(path)
|
||||
except sqlite3.OperationalError:
|
||||
except SQLITE_ERRORS:
|
||||
self.io.tool_warning(f"Unable to use tags cache, delete {path} to resolve.")
|
||||
self.TAGS_CACHE = dict()
|
||||
|
||||
@@ -195,8 +198,12 @@ class RepoMap:
|
||||
data = list(self.get_tags_raw(fname, rel_fname))
|
||||
|
||||
# Update the cache
|
||||
self.TAGS_CACHE[cache_key] = {"mtime": file_mtime, "data": data}
|
||||
self.save_tags_cache()
|
||||
try:
|
||||
self.TAGS_CACHE[cache_key] = {"mtime": file_mtime, "data": data}
|
||||
self.save_tags_cache()
|
||||
except SQLITE_ERRORS:
|
||||
pass
|
||||
|
||||
return data
|
||||
|
||||
def get_tags_raw(self, fname, rel_fname):
|
||||
@@ -316,6 +323,9 @@ class RepoMap:
|
||||
if not file_ok:
|
||||
if fname not in self.warned_files:
|
||||
self.io.tool_warning(f"Repo-map can't include {fname}")
|
||||
self.io.tool_output(
|
||||
"Has it been deleted from the file system but not from git?"
|
||||
)
|
||||
self.warned_files.add(fname)
|
||||
continue
|
||||
|
||||
|
||||
@@ -34,13 +34,14 @@ def get_git_info():
|
||||
return "Git information unavailable"
|
||||
|
||||
|
||||
def report_github_issue(issue_text, title=None):
|
||||
def report_github_issue(issue_text, title=None, confirm=True):
|
||||
"""
|
||||
Compose a URL to open a new GitHub issue with the given text prefilled,
|
||||
and attempt to launch it in the default web browser.
|
||||
|
||||
:param issue_text: The text of the issue to file
|
||||
:param title: The title of the issue (optional)
|
||||
:param confirm: Whether to ask for confirmation before opening the browser (default: True)
|
||||
:return: None
|
||||
"""
|
||||
version_info = f"Aider version: {__version__}\n"
|
||||
@@ -61,16 +62,17 @@ def report_github_issue(issue_text, title=None):
|
||||
params["title"] = title
|
||||
issue_url = f"{github_issues}?{urllib.parse.urlencode(params)}"
|
||||
|
||||
print(f"\n# {title}\n")
|
||||
print(issue_text.strip())
|
||||
print()
|
||||
print("Please consider reporting this bug to help improve aider!")
|
||||
prompt = "Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) "
|
||||
confirmation = input(prompt).strip().lower()
|
||||
if confirm:
|
||||
print(f"\n# {title}\n")
|
||||
print(issue_text.strip())
|
||||
print()
|
||||
print("Please consider reporting this bug to help improve aider!")
|
||||
prompt = "Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) "
|
||||
confirmation = input(prompt).strip().lower()
|
||||
|
||||
yes = not confirmation or confirmation.startswith("y")
|
||||
if not yes:
|
||||
return
|
||||
yes = not confirmation or confirmation.startswith("y")
|
||||
if not yes:
|
||||
return
|
||||
|
||||
print("Attempting to open the issue URL in your default web browser...")
|
||||
try:
|
||||
@@ -79,13 +81,14 @@ def report_github_issue(issue_text, title=None):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
print()
|
||||
print()
|
||||
print("You can also use this URL to file the GitHub Issue:")
|
||||
print()
|
||||
print(issue_url)
|
||||
print()
|
||||
print()
|
||||
if confirm:
|
||||
print()
|
||||
print()
|
||||
print("You can also use this URL to file the GitHub Issue:")
|
||||
print()
|
||||
print(issue_url)
|
||||
print()
|
||||
print()
|
||||
|
||||
|
||||
def exception_handler(exc_type, exc_value, exc_traceback):
|
||||
|
||||
@@ -16,6 +16,17 @@ cog.out(text)
|
||||
|
||||
# Release history
|
||||
|
||||
### main branch
|
||||
|
||||
- New `/report` command to open your browser with a pre-populated GitHub Issue.
|
||||
- New `--chat-language` switch to set the spoken language.
|
||||
- Now `--[no-]suggest-shell-commands` controls both prompting for and offering to execute shell commands.
|
||||
- DeepSeek models use 8192 output tokens.
|
||||
- Check key imports on launch, provide helpful error message if dependencies aren't available.
|
||||
- Renamed `--models` to `--list-models`.
|
||||
- Numerous bug fixes for corner case crashes.
|
||||
- Aider wrote 56% of the code in this release.
|
||||
|
||||
### Aider v0.55.0
|
||||
|
||||
- Only print the pip command when self updating on Windows, without running it.
|
||||
|
||||
@@ -2380,3 +2380,105 @@
|
||||
Paul Gauthier (aider): 204
|
||||
start_tag: v0.53.0
|
||||
total_lines: 319
|
||||
- aider_percentage: 52.9
|
||||
aider_total: 811
|
||||
end_date: '2024-09-04'
|
||||
end_tag: v0.55.0
|
||||
file_counts:
|
||||
aider/__init__.py:
|
||||
Paul Gauthier: 4
|
||||
Paul Gauthier (aider): 2
|
||||
aider/args.py:
|
||||
Paul Gauthier (aider): 7
|
||||
aider/coders/base_coder.py:
|
||||
Paul Gauthier: 63
|
||||
Paul Gauthier (aider): 42
|
||||
aider/coders/editblock_coder.py:
|
||||
Nikolay Sedelnikov: 8
|
||||
aider/coders/editblock_func_coder.py:
|
||||
Antti Kaihola: 2
|
||||
aider/coders/search_replace.py:
|
||||
Paul Gauthier: 2
|
||||
aider/coders/wholefile_coder.py:
|
||||
Paul Gauthier: 16
|
||||
aider/commands.py:
|
||||
Antti Kaihola: 7
|
||||
Paul Gauthier: 85
|
||||
Paul Gauthier (aider): 27
|
||||
aider/format_settings.py:
|
||||
Paul Gauthier (aider): 26
|
||||
aider/gui.py:
|
||||
Paul Gauthier: 4
|
||||
aider/io.py:
|
||||
Paul Gauthier: 63
|
||||
Paul Gauthier (aider): 13
|
||||
aider/linter.py:
|
||||
Paul Gauthier: 5
|
||||
aider/llm.py:
|
||||
Paul Gauthier: 2
|
||||
aider/main.py:
|
||||
Paul Gauthier: 86
|
||||
Paul Gauthier (aider): 22
|
||||
aider/models.py:
|
||||
Paul Gauthier: 24
|
||||
Paul Gauthier (aider): 2
|
||||
aider/repo.py:
|
||||
Paul Gauthier: 85
|
||||
aider/repomap.py:
|
||||
Paul Gauthier: 32
|
||||
Paul Gauthier (aider): 4
|
||||
aider/report.py:
|
||||
Paul Gauthier: 77
|
||||
Paul Gauthier (aider): 120
|
||||
aider/run_cmd.py:
|
||||
Paul Gauthier: 17
|
||||
Paul Gauthier (aider): 24
|
||||
aider/scrape.py:
|
||||
Paul Gauthier: 7
|
||||
Paul Gauthier (aider): 8
|
||||
aider/special.py:
|
||||
Paul Gauthier: 5
|
||||
Paul Gauthier (aider): 197
|
||||
aider/urls.py:
|
||||
Paul Gauthier (aider): 1
|
||||
aider/utils.py:
|
||||
Paul Gauthier: 31
|
||||
Paul Gauthier (aider): 29
|
||||
aider/versioncheck.py:
|
||||
Paul Gauthier: 32
|
||||
Paul Gauthier (aider): 6
|
||||
aider/voice.py:
|
||||
Paul Gauthier: 7
|
||||
Paul Gauthier (aider): 9
|
||||
scripts/versionbump.py:
|
||||
Paul Gauthier: 9
|
||||
tests/basic/test_coder.py:
|
||||
Paul Gauthier: 3
|
||||
Paul Gauthier (aider): 105
|
||||
tests/basic/test_editblock.py:
|
||||
Antti Kaihola: 3
|
||||
Nikolay Sedelnikov: 37
|
||||
tests/basic/test_io.py:
|
||||
Paul Gauthier: 2
|
||||
Paul Gauthier (aider): 15
|
||||
tests/basic/test_main.py:
|
||||
Paul Gauthier: 2
|
||||
Paul Gauthier (aider): 10
|
||||
tests/basic/test_models.py:
|
||||
Paul Gauthier (aider): 4
|
||||
tests/basic/test_repomap.py:
|
||||
Paul Gauthier (aider): 42
|
||||
tests/basic/test_run_cmd.py:
|
||||
Paul Gauthier (aider): 11
|
||||
tests/basic/test_special.py:
|
||||
Paul Gauthier: 2
|
||||
Paul Gauthier (aider): 74
|
||||
tests/scrape/test_scrape.py:
|
||||
Paul Gauthier (aider): 11
|
||||
grand_total:
|
||||
Antti Kaihola: 12
|
||||
Nikolay Sedelnikov: 45
|
||||
Paul Gauthier: 665
|
||||
Paul Gauthier (aider): 811
|
||||
start_tag: v0.54.0
|
||||
total_lines: 1533
|
||||
|
||||
@@ -317,29 +317,6 @@
|
||||
seconds_per_case: 22.9
|
||||
total_cost: 2.7494
|
||||
|
||||
- dirname: 2024-05-09-18-57-52--deepseek-chat-v2-diff-reverted-and-helpful-assistant2
|
||||
test_cases: 133
|
||||
model: DeepSeek Chat V2 (original)
|
||||
released: 2024-05-06
|
||||
edit_format: diff
|
||||
commit_hash: 80a3f6d
|
||||
pass_rate_1: 44.4
|
||||
pass_rate_2: 60.9
|
||||
percent_cases_well_formed: 97.0
|
||||
error_outputs: 14
|
||||
num_malformed_responses: 4
|
||||
user_asks: 2
|
||||
lazy_comments: 0
|
||||
syntax_errors: 13
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 3
|
||||
command: aider --model deepseek/deepseek-chat
|
||||
date: 2024-05-09
|
||||
versions: 0.33.1-dev
|
||||
seconds_per_case: 86.8
|
||||
total_cost: 0.0941
|
||||
|
||||
- dirname: 2024-05-07-20-32-37--qwen1.5-110b-chat-whole
|
||||
test_cases: 133
|
||||
model: qwen1.5-110b-chat
|
||||
@@ -665,7 +642,7 @@
|
||||
|
||||
- dirname: 2024-07-19-08-57-13--openrouter-deepseek-chat-v2-0628
|
||||
test_cases: 133
|
||||
model: DeepSeek Chat V2 0628
|
||||
model: DeepSeek Chat V2 0628 (deprecated)
|
||||
edit_format: diff
|
||||
commit_hash: 96ff06e-dirty
|
||||
pass_rate_1: 60.9
|
||||
@@ -737,7 +714,7 @@
|
||||
|
||||
- dirname: 2024-07-24-07-10-58--deepseek-coder2-0724-diff-direct
|
||||
test_cases: 133
|
||||
model: DeepSeek Coder V2 0724
|
||||
model: DeepSeek Coder V2 0724 (deprecated)
|
||||
edit_format: diff
|
||||
commit_hash: 89965bf
|
||||
pass_rate_1: 57.9
|
||||
@@ -969,4 +946,97 @@
|
||||
date: 2024-08-30
|
||||
versions: 0.54.8-dev
|
||||
seconds_per_case: 38.3
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2024-09-04-16-08-09--yi-coder-9b-whole
|
||||
test_cases: 133
|
||||
model: Yi Coder 9B Chat
|
||||
edit_format: whole
|
||||
commit_hash: c4e4967
|
||||
pass_rate_1: 46.6
|
||||
pass_rate_2: 54.1
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 0
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 9
|
||||
lazy_comments: 0
|
||||
syntax_errors: 14
|
||||
indentation_errors: 2
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 4
|
||||
command: aider --model openai/hf:01-ai/Yi-Coder-9B-Chat --openai-api-base https://glhf.chat/api/openai/v1
|
||||
date: 2024-09-04
|
||||
versions: 0.54.13.dev
|
||||
seconds_per_case: 8.3
|
||||
total_cost: 0.0000
|
||||
released: 2024-09-04
|
||||
|
||||
- dirname: 2024-09-04-16-17-33--yi-coder-9b-chat-q4_0-whole
|
||||
test_cases: 133
|
||||
model: yi-coder:9b-chat-q4_0
|
||||
edit_format: whole
|
||||
commit_hash: c4e4967
|
||||
pass_rate_1: 41.4
|
||||
pass_rate_2: 45.1
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 0
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 48
|
||||
lazy_comments: 1
|
||||
syntax_errors: 1
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 0
|
||||
command: aider --model ollama/yi-coder:9b-chat-q4_0
|
||||
date: 2024-09-04
|
||||
versions: 0.54.13.dev
|
||||
seconds_per_case: 125.3
|
||||
total_cost: 0.0000
|
||||
|
||||
- dirname: 2024-09-05-14-50-11--deepseek-sep5-no-shell
|
||||
test_cases: 133
|
||||
model: DeepSeek V2.5
|
||||
edit_format: diff
|
||||
commit_hash: 1279c86
|
||||
pass_rate_1: 54.9
|
||||
pass_rate_2: 72.2
|
||||
percent_cases_well_formed: 96.2
|
||||
error_outputs: 5
|
||||
num_malformed_responses: 5
|
||||
num_with_malformed_responses: 5
|
||||
user_asks: 4
|
||||
lazy_comments: 0
|
||||
syntax_errors: 1
|
||||
indentation_errors: 0
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 2
|
||||
command: aider --deepseek
|
||||
date: 2024-09-05
|
||||
versions: 0.55.1.dev
|
||||
seconds_per_case: 49.6
|
||||
total_cost: 0.0998
|
||||
|
||||
- dirname: 2024-09-06-19-55-17--reflection-hyperbolic-whole-output2
|
||||
test_cases: 133
|
||||
model: Reflection-70B
|
||||
edit_format: whole
|
||||
commit_hash: 74631ee-dirty, 2aef59e-dirty
|
||||
pass_rate_1: 33.1
|
||||
pass_rate_2: 42.1
|
||||
percent_cases_well_formed: 100.0
|
||||
error_outputs: 2
|
||||
num_malformed_responses: 0
|
||||
num_with_malformed_responses: 0
|
||||
user_asks: 10
|
||||
lazy_comments: 26
|
||||
syntax_errors: 1
|
||||
indentation_errors: 3
|
||||
exhausted_context_windows: 0
|
||||
test_timeouts: 3
|
||||
command: (not currently supported)
|
||||
date: 2024-09-06
|
||||
versions: 0.55.1.dev
|
||||
seconds_per_case: 61.6
|
||||
total_cost: 0.0000
|
||||
@@ -167,7 +167,7 @@
|
||||
|
||||
- dirname: 2024-07-24-07-49-39--refac-deepseek-coder-v2-0724
|
||||
test_cases: 89
|
||||
model: DeepSeek Coder V2 0724
|
||||
model: DeepSeek Coder V2 0724 (deprecated)
|
||||
edit_format: diff
|
||||
commit_hash: bb6e597
|
||||
pass_rate_1: 32.6
|
||||
@@ -208,4 +208,25 @@
|
||||
versions: 0.48.1-dev
|
||||
seconds_per_case: 16.9
|
||||
total_cost: 4.0873
|
||||
|
||||
|
||||
- dirname: 2024-09-05-15-19-05--refac-deepseek-v2.5-no-shell
|
||||
test_cases: 89
|
||||
model: DeepSeek Chat V2.5
|
||||
edit_format: diff
|
||||
commit_hash: 1279c86, 1279c86-dirty
|
||||
pass_rate_1: 31.5
|
||||
percent_cases_well_formed: 67.4
|
||||
error_outputs: 90
|
||||
num_malformed_responses: 88
|
||||
num_with_malformed_responses: 29
|
||||
user_asks: 8
|
||||
lazy_comments: 7
|
||||
syntax_errors: 0
|
||||
indentation_errors: 6
|
||||
exhausted_context_windows: 2
|
||||
test_timeouts: 0
|
||||
command: aider --deepseek
|
||||
date: 2024-09-05
|
||||
versions: 0.55.1.dev
|
||||
seconds_per_case: 225.4
|
||||
total_cost: 1.0338
|
||||
9
aider/website/_includes/replit-pipx.md
Normal file
9
aider/website/_includes/replit-pipx.md
Normal file
@@ -0,0 +1,9 @@
|
||||
To use aider with pipx on replit, you can run these commands in the replit shell:
|
||||
|
||||
```
|
||||
pip install pipx
|
||||
pipx run aider-chat ...normal aider args...
|
||||
```
|
||||
|
||||
If you install aider with pipx on replit and try and run it as just `aider` it will crash with a missing `libstdc++.so.6` library.
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
# Model Settings:
|
||||
|
||||
## List known models which match the (partial) MODEL name
|
||||
#models:
|
||||
#list-models:
|
||||
|
||||
## Specify the api base url
|
||||
#openai-api-base:
|
||||
@@ -239,6 +239,9 @@
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#voice-language: en
|
||||
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#chat-language:
|
||||
|
||||
## Show the version number and exit
|
||||
#version:
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
# Model Settings:
|
||||
|
||||
## List known models which match the (partial) MODEL name
|
||||
#AIDER_MODELS=
|
||||
#AIDER_LIST_MODELS=
|
||||
|
||||
## Specify the api base url
|
||||
#OPENAI_API_BASE=
|
||||
@@ -243,6 +243,9 @@
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#AIDER_VOICE_LANGUAGE=en
|
||||
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#AIDER_CHAT_LANGUAGE=
|
||||
|
||||
## Check for updates and return status in the exit code
|
||||
#AIDER_JUST_CHECK_UPDATE=false
|
||||
|
||||
|
||||
@@ -89,3 +89,8 @@ The yaml file should be a a list of dictionary objects for each model, as follow
|
||||
examples_as_sys_msg: false
|
||||
```
|
||||
|
||||
You can look at the `ModelSettings` class in
|
||||
[models.py](https://github.com/paul-gauthier/aider/blob/main/aider/models.py)
|
||||
file for details about all of the model setting that aider supports.
|
||||
That file also contains the settings for many popular models.
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ cog.outl("```")
|
||||
# Model Settings:
|
||||
|
||||
## List known models which match the (partial) MODEL name
|
||||
#models:
|
||||
#list-models:
|
||||
|
||||
## Specify the api base url
|
||||
#openai-api-base:
|
||||
@@ -287,6 +287,9 @@ cog.outl("```")
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#voice-language: en
|
||||
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#chat-language:
|
||||
|
||||
## Show the version number and exit
|
||||
#version:
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ cog.outl("```")
|
||||
# Model Settings:
|
||||
|
||||
## List known models which match the (partial) MODEL name
|
||||
#AIDER_MODELS=
|
||||
#AIDER_LIST_MODELS=
|
||||
|
||||
## Specify the api base url
|
||||
#OPENAI_API_BASE=
|
||||
@@ -285,6 +285,9 @@ cog.outl("```")
|
||||
## Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
#AIDER_VOICE_LANGUAGE=en
|
||||
|
||||
## Specify the language to use in the chat (default: None, uses system settings)
|
||||
#AIDER_CHAT_LANGUAGE=
|
||||
|
||||
## Check for updates and return status in the exit code
|
||||
#AIDER_JUST_CHECK_UPDATE=false
|
||||
|
||||
|
||||
@@ -27,10 +27,11 @@ cog.out(get_md_help())
|
||||
```
|
||||
usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
|
||||
[--opus] [--sonnet] [--4] [--4o] [--mini] [--4-turbo]
|
||||
[--35turbo] [--deepseek] [--models] [--openai-api-base]
|
||||
[--openai-api-type] [--openai-api-version]
|
||||
[--openai-api-deployment-id] [--openai-organization-id]
|
||||
[--model-settings-file] [--model-metadata-file]
|
||||
[--35turbo] [--deepseek] [--list-models]
|
||||
[--openai-api-base] [--openai-api-type]
|
||||
[--openai-api-version] [--openai-api-deployment-id]
|
||||
[--openai-organization-id] [--model-settings-file]
|
||||
[--model-metadata-file]
|
||||
[--verify-ssl | --no-verify-ssl] [--edit-format]
|
||||
[--weak-model]
|
||||
[--show-model-warnings | --no-show-model-warnings]
|
||||
@@ -57,7 +58,7 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
|
||||
[--lint] [--lint-cmd] [--auto-lint | --no-auto-lint]
|
||||
[--test-cmd] [--auto-test | --no-auto-test] [--test]
|
||||
[--file] [--read] [--vim] [--voice-language]
|
||||
[--version] [--just-check-update]
|
||||
[--chat-language] [--version] [--just-check-update]
|
||||
[--check-update | --no-check-update]
|
||||
[--install-main-branch] [--upgrade] [--apply] [--yes]
|
||||
[-v] [--show-repo-map] [--show-prompts] [--exit]
|
||||
@@ -130,9 +131,12 @@ Environment variable: `AIDER_DEEPSEEK`
|
||||
|
||||
## Model Settings:
|
||||
|
||||
### `--models MODEL`
|
||||
### `--list-models MODEL`
|
||||
List known models which match the (partial) MODEL name
|
||||
Environment variable: `AIDER_MODELS`
|
||||
Environment variable: `AIDER_LIST_MODELS`
|
||||
Aliases:
|
||||
- `--list-models MODEL`
|
||||
- `--models MODEL`
|
||||
|
||||
### `--openai-api-base OPENAI_API_BASE`
|
||||
Specify the api base url
|
||||
@@ -464,6 +468,10 @@ Specify the language for voice using ISO 639-1 code (default: auto)
|
||||
Default: en
|
||||
Environment variable: `AIDER_VOICE_LANGUAGE`
|
||||
|
||||
### `--chat-language CHAT_LANGUAGE`
|
||||
Specify the language to use in the chat (default: None, uses system settings)
|
||||
Environment variable: `AIDER_CHAT_LANGUAGE`
|
||||
|
||||
### `--version`
|
||||
Show the version number and exit
|
||||
|
||||
|
||||
@@ -29,12 +29,5 @@ pipx install aider-chat
|
||||
|
||||
## pipx on replit
|
||||
|
||||
To use aider with pipx on replit, you can run these commands in the replit shell:
|
||||
|
||||
```
|
||||
pip install pipx
|
||||
pipx run aider-chat ...normal aider args...
|
||||
```
|
||||
|
||||
If you install aider with pipx on replit and try and run it as just `aider` it will crash with a missing `libstdc++.so.6` library.
|
||||
{% include replit-pipx.md %}
|
||||
|
||||
|
||||
@@ -321,6 +321,6 @@ mod_dates = [get_last_modified_date(file) for file in files]
|
||||
latest_mod_date = max(mod_dates)
|
||||
cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}")
|
||||
]]]-->
|
||||
August 30, 2024.
|
||||
September 06, 2024.
|
||||
<!--[[[end]]]-->
|
||||
</p>
|
||||
|
||||
@@ -26,7 +26,7 @@ aider
|
||||
aider --opus
|
||||
|
||||
# List models available from Anthropic
|
||||
aider --models anthropic/
|
||||
aider --list-models anthropic/
|
||||
```
|
||||
|
||||
{: .tip }
|
||||
|
||||
@@ -24,7 +24,7 @@ setx AZURE_API_BASE https://myendpt.openai.azure.com
|
||||
aider --model azure/<your_deployment_name>
|
||||
|
||||
# List models available from Azure
|
||||
aider --models azure/
|
||||
aider --list-models azure/
|
||||
```
|
||||
|
||||
Note that aider will also use environment variables
|
||||
|
||||
@@ -54,7 +54,7 @@ aider --model bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0
|
||||
To see some models available via Bedrock, run:
|
||||
|
||||
```
|
||||
aider --models bedrock/
|
||||
aider --list-models bedrock/
|
||||
```
|
||||
|
||||
Make sure you have access to these models in your AWS account before attempting to use them with Aider.
|
||||
|
||||
@@ -21,5 +21,5 @@ setx COHERE_API_KEY <key> # Windows, restart shell after setx
|
||||
aider --model command-r-plus
|
||||
|
||||
# List models available from Cohere
|
||||
aider --models cohere_chat/
|
||||
aider --list-models cohere_chat/
|
||||
```
|
||||
|
||||
@@ -20,6 +20,6 @@ setx GEMINI_API_KEY <key> # Windows, restart shell after setx
|
||||
aider --model gemini/gemini-1.5-pro-latest
|
||||
|
||||
# List models available from Gemini
|
||||
aider --models gemini/
|
||||
aider --list-models gemini/
|
||||
```
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ setx GROQ_API_KEY <key> # Windows, restart shell after setx
|
||||
aider --model groq/llama3-70b-8192
|
||||
|
||||
# List models available from Groq
|
||||
aider --models groq/
|
||||
aider --list-models groq/
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ aider --4-turbo
|
||||
aider --35-turbo
|
||||
|
||||
# List models available from OpenAI
|
||||
aider --models openai/
|
||||
aider --list-models openai/
|
||||
```
|
||||
|
||||
You can use `aider --model <model-name>` to use any other OpenAI model.
|
||||
|
||||
@@ -18,7 +18,7 @@ setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx
|
||||
aider --model openrouter/<provider>/<model>
|
||||
|
||||
# List models available from OpenRouter
|
||||
aider --models openrouter/
|
||||
aider --list-models openrouter/
|
||||
```
|
||||
|
||||
In particular, many aider users access Sonnet via OpenRouter:
|
||||
|
||||
@@ -9,14 +9,14 @@ Aider uses the [litellm](https://docs.litellm.ai/docs/providers) package
|
||||
to connect to hundreds of other models.
|
||||
You can use `aider --model <model-name>` to use any supported model.
|
||||
|
||||
To explore the list of supported models you can run `aider --models <model-name>`
|
||||
To explore the list of supported models you can run `aider --list-models <model-name>`
|
||||
with a partial model name.
|
||||
If the supplied name is not an exact match for a known model, aider will
|
||||
return a list of possible matching models.
|
||||
For example:
|
||||
|
||||
```
|
||||
$ aider --models turbo
|
||||
$ aider --list-models turbo
|
||||
|
||||
Aider v0.29.3-dev
|
||||
Models which match "turbo":
|
||||
|
||||
31
aider/website/docs/troubleshooting/imports.md
Normal file
31
aider/website/docs/troubleshooting/imports.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
parent: Troubleshooting
|
||||
nav_order: 28
|
||||
---
|
||||
|
||||
# Import errors
|
||||
|
||||
Aider expects to be installed via `pip` or `pipx`, which will install
|
||||
all of its required dependencies.
|
||||
If aider reports `ImportErrors`, this probably means it has been installed
|
||||
incorrectly.
|
||||
|
||||
|
||||
## Dependency versions
|
||||
|
||||
Aider pins its dependencies and is tested to work with those specific versions.
|
||||
You should be careful about upgrading or downgrading other python libraries that
|
||||
aider uses.
|
||||
|
||||
If you need other versions of packages for your project,
|
||||
consider
|
||||
[installing aider using pipx](/docs/install/pipx.html).
|
||||
|
||||
|
||||
|
||||
## Replit
|
||||
|
||||
You can `pip install aider-chat` on replit, or you can install it via
|
||||
pipx.
|
||||
|
||||
{% include replit-pipx.md %}
|
||||
@@ -34,6 +34,7 @@ cog.out(get_help_md())
|
||||
| **/models** | Search the list of available models |
|
||||
| **/quit** | Exit the application |
|
||||
| **/read-only** | Add files to the chat that are for reference, not to be edited |
|
||||
| **/report** | Report a problem by opening a GitHub Issue |
|
||||
| **/reset** | Drop all files and clear the chat history |
|
||||
| **/run** | Run a shell command and optionally add the output to the chat (alias: !) |
|
||||
| **/settings** | Print out the current settings |
|
||||
|
||||
@@ -8,6 +8,7 @@ description: Intro and tutorial videos made by aider users.
|
||||
|
||||
Here are some tutorial videos made by aider users:
|
||||
|
||||
- [Aider and Replit on mobile with your voice](https://x.com/itsPaulAi/status/1830987090617831810) -- Paul Couvert
|
||||
- [Aider is the OG AI Coding King (Mermaid Diagram AI Agent)](https://www.youtube.com/watch?v=ag-KxYS8Vuw) -- IndyDevDan
|
||||
- [Installing aider in replit and making a Trello clone](https://x.com/itspaulai/status/1828834199597633724) -- Paul Couvert
|
||||
- [Step-by-Step Development Environment Setup for AI-Assisted Coding](https://www.youtube.com/watch?v=DnBVgfe6ZQM) -- Coding the Future With AI
|
||||
|
||||
@@ -567,6 +567,7 @@ def run_test_real(
|
||||
verbose=verbose,
|
||||
# auto_lint=False, # disabled for code-in-json experiments
|
||||
cache_prompts=True,
|
||||
suggest_shell_commands=False,
|
||||
)
|
||||
coder.max_apply_update_errors = max_apply_update_errors
|
||||
|
||||
|
||||
52
tests/basic/test_linter.py
Normal file
52
tests/basic/test_linter.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from aider.dump import dump # noqa
|
||||
from aider.linter import Linter
|
||||
|
||||
|
||||
class TestLinter(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.linter = Linter(encoding="utf-8", root="/test/root")
|
||||
|
||||
def test_init(self):
|
||||
self.assertEqual(self.linter.encoding, "utf-8")
|
||||
self.assertEqual(self.linter.root, "/test/root")
|
||||
self.assertIn("python", self.linter.languages)
|
||||
|
||||
def test_set_linter(self):
|
||||
self.linter.set_linter("javascript", "eslint")
|
||||
self.assertEqual(self.linter.languages["javascript"], "eslint")
|
||||
|
||||
def test_get_rel_fname(self):
|
||||
import os
|
||||
|
||||
self.assertEqual(self.linter.get_rel_fname("/test/root/file.py"), "file.py")
|
||||
expected_path = os.path.normpath("../../other/path/file.py")
|
||||
actual_path = os.path.normpath(self.linter.get_rel_fname("/other/path/file.py"))
|
||||
self.assertEqual(actual_path, expected_path)
|
||||
|
||||
@patch("subprocess.Popen")
|
||||
def test_run_cmd(self, mock_popen):
|
||||
mock_process = MagicMock()
|
||||
mock_process.returncode = 0
|
||||
mock_process.communicate.return_value = ("", None)
|
||||
mock_popen.return_value = mock_process
|
||||
|
||||
result = self.linter.run_cmd("test_cmd", "test_file.py", "code")
|
||||
self.assertIsNone(result)
|
||||
|
||||
@patch("subprocess.Popen")
|
||||
def test_run_cmd_with_errors(self, mock_popen):
|
||||
mock_process = MagicMock()
|
||||
mock_process.returncode = 1
|
||||
mock_process.communicate.return_value = ("Error message", None)
|
||||
mock_popen.return_value = mock_process
|
||||
|
||||
result = self.linter.run_cmd("test_cmd", "test_file.py", "code")
|
||||
self.assertIsNotNone(result)
|
||||
self.assertIn("Error message", result.text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -620,6 +620,17 @@ class TestMain(TestCase):
|
||||
)
|
||||
self.assertTrue(coder.suggest_shell_commands)
|
||||
|
||||
def test_chat_language_spanish(self):
|
||||
with GitTemporaryDirectory():
|
||||
coder = main(
|
||||
["--chat-language", "Spanish", "--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
)
|
||||
system_info = coder.get_platform_info()
|
||||
self.assertIn("Spanish", system_info)
|
||||
|
||||
@patch("git.Repo.init")
|
||||
def test_main_exit_with_git_command_not_found(self, mock_git_init):
|
||||
mock_git_init.side_effect = git.exc.GitCommandNotFound("git", "Command 'git' not found")
|
||||
|
||||
Reference in New Issue
Block a user