Merge branch 'main' into mixpanel

This commit is contained in:
Paul Gauthier 2024-10-30 09:40:01 -07:00
commit 068fb38a5d
181 changed files with 141428 additions and 1961 deletions

View file

@ -22,9 +22,10 @@ def default_env_file(git_root):
def get_parser(default_config_files, git_root):
parser = configargparse.ArgumentParser(
description="aider is GPT powered coding in your terminal",
description="aider is AI pair programming in your terminal",
add_config_file_help=True,
default_config_files=default_config_files,
config_file_parser_class=configargparse.YAMLConfigFileParser,
auto_env_var_prefix="AIDER_",
)
group = parser.add_argument_group("Main")
@ -57,7 +58,7 @@ def get_parser(default_config_files, git_root):
const=opus_model,
help=f"Use {opus_model} model for the main chat",
)
sonnet_model = "claude-3-5-sonnet-20240620"
sonnet_model = "claude-3-5-sonnet-20241022"
group.add_argument(
"--sonnet",
action="store_const",
@ -74,7 +75,7 @@ def get_parser(default_config_files, git_root):
const=gpt_4_model,
help=f"Use {gpt_4_model} model for the main chat",
)
gpt_4o_model = "gpt-4o"
gpt_4o_model = "gpt-4o-2024-08-06"
group.add_argument(
"--4o",
action="store_const",
@ -117,10 +118,27 @@ def get_parser(default_config_files, git_root):
const=deepseek_model,
help=f"Use {deepseek_model} model for the main chat",
)
o1_mini_model = "o1-mini"
group.add_argument(
"--o1-mini",
action="store_const",
dest="model",
const=o1_mini_model,
help=f"Use {o1_mini_model} model for the main chat",
)
o1_preview_model = "o1-preview"
group.add_argument(
"--o1-preview",
action="store_const",
dest="model",
const=o1_preview_model,
help=f"Use {o1_preview_model} model for the main chat",
)
##########
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",
@ -180,6 +198,13 @@ def get_parser(default_config_files, git_root):
default=None,
help="Specify what edit format the LLM should use (default depends on model)",
)
group.add_argument(
"--architect",
action="store_const",
dest="edit_format",
const="architect",
help="Use architect edit format for the main chat",
)
group.add_argument(
"--weak-model",
metavar="WEAK_MODEL",
@ -189,25 +214,31 @@ def get_parser(default_config_files, git_root):
" depends on --model)"
),
)
group.add_argument(
"--editor-model",
metavar="EDITOR_MODEL",
default=None,
help="Specify the model to use for editor tasks (default depends on --model)",
)
group.add_argument(
"--editor-edit-format",
metavar="EDITOR_EDIT_FORMAT",
default=None,
help="Specify the edit format for the editor model (default: depends on editor model)",
)
group.add_argument(
"--show-model-warnings",
action=argparse.BooleanOptionalAction,
default=True,
help="Only work with models that have meta-data available (default: True)",
)
group.add_argument(
"--map-tokens",
type=int,
default=None,
help="Max number of tokens to use for repo map, use 0 to disable (default: 1024)",
)
group.add_argument(
"--max-chat-history-tokens",
type=int,
default=None,
help=(
"Maximum number of tokens to use for chat history. If not specified, uses the model's"
" max_chat_history_tokens."
"Soft limit on tokens for chat history, after which summarization begins."
" If unspecified, defaults to the model's max_chat_history_tokens."
),
)
# This is a duplicate of the argument in the preparser and is a no-op by this time of
@ -219,6 +250,45 @@ def get_parser(default_config_files, git_root):
help="Specify the .env file to load (default: .env in git root)",
)
##########
group = parser.add_argument_group("Cache Settings")
group.add_argument(
"--cache-prompts",
action=argparse.BooleanOptionalAction,
default=False,
help="Enable caching of prompts (default: False)",
)
group.add_argument(
"--cache-keepalive-pings",
type=int,
default=0,
help="Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)",
)
##########
group = parser.add_argument_group("Repomap Settings")
group.add_argument(
"--map-tokens",
type=int,
default=None,
help="Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)",
)
group.add_argument(
"--map-refresh",
choices=["auto", "always", "files", "manual"],
default="auto",
help=(
"Control how often the repo map is refreshed. Options: auto, always, files, manual"
" (default: auto)"
),
)
group.add_argument(
"--map-multiplier-no-files",
type=float,
default=2,
help="Multiplier for map tokens when no files are specified (default: 2)",
)
##########
group = parser.add_argument_group("History Files")
default_input_history_file = (
@ -291,13 +361,51 @@ def get_parser(default_config_files, git_root):
group.add_argument(
"--tool-error-color",
default="#FF2222",
help="Set the color for tool error messages (default: red)",
help="Set the color for tool error messages (default: #FF2222)",
)
group.add_argument(
"--tool-warning-color",
default="#FFA500",
help="Set the color for tool warning messages (default: #FFA500)",
)
group.add_argument(
"--assistant-output-color",
default="#0088ff",
help="Set the color for assistant output (default: #0088ff)",
)
group.add_argument(
"--completion-menu-color",
metavar="COLOR",
default=None,
help="Set the color for the completion menu (default: terminal's default text color)",
)
group.add_argument(
"--completion-menu-bg-color",
metavar="COLOR",
default=None,
help=(
"Set the background color for the completion menu (default: terminal's default"
" background color)"
),
)
group.add_argument(
"--completion-menu-current-color",
metavar="COLOR",
default=None,
help=(
"Set the color for the current item in the completion menu (default: terminal's default"
" background color)"
),
)
group.add_argument(
"--completion-menu-current-bg-color",
metavar="COLOR",
default=None,
help=(
"Set the background color for the current item in the completion menu (default:"
" terminal's default text color)"
),
)
group.add_argument(
"--code-theme",
default="default",
@ -395,6 +503,12 @@ def get_parser(default_config_files, git_root):
default=False,
help="Perform a dry run without modifying files (default: False)",
)
group.add_argument(
"--skip-sanity-check-repo",
action="store_true",
help="Skip the sanity check for the git repository (default: False)",
default=False,
)
group = parser.add_argument_group("Fixing and committing")
group.add_argument(
"--lint",
@ -475,10 +589,10 @@ def get_parser(default_config_files, git_root):
default=False,
)
group.add_argument(
"--voice-language",
metavar="VOICE_LANGUAGE",
default="en",
help="Specify the language for voice using ISO 639-1 code (default: auto)",
"--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",
@ -498,13 +612,26 @@ def get_parser(default_config_files, git_root):
help="Check for new aider versions on launch",
default=True,
)
group.add_argument(
"--install-main-branch",
action="store_true",
help="Install the latest version from the main branch",
default=False,
)
group.add_argument(
"--upgrade",
"--update",
action="store_true",
help="Upgrade aider to the latest version from PyPI",
default=False,
)
group.add_argument(
"--apply",
metavar="FILE",
help="Apply the changes from the given file instead of running the chat (debug)",
)
group.add_argument(
"--yes",
"--yes-always",
action="store_true",
help="Always say yes to every confirmation",
default=None,
@ -552,6 +679,11 @@ def get_parser(default_config_files, git_root):
" (disables chat mode)"
),
)
group.add_argument(
"--load",
metavar="LOAD_FILE",
help="Load and execute /commands from a file on launch",
)
group.add_argument(
"--encoding",
default="utf-8",
@ -574,6 +706,34 @@ def get_parser(default_config_files, git_root):
help="Run aider in your browser",
default=False,
)
group.add_argument(
"--suggest-shell-commands",
action=argparse.BooleanOptionalAction,
default=True,
help="Enable/disable suggesting shell commands (default: True)",
)
group.add_argument(
"--fancy-input",
action=argparse.BooleanOptionalAction,
default=True,
help="Enable/disable fancy input with history and completion (default: True)",
)
##########
group = parser.add_argument_group("Voice Settings")
group.add_argument(
"--voice-format",
metavar="VOICE_FORMAT",
default="wav",
choices=["wav", "mp3", "webm"],
help="Audio format for voice recording (default: wav). webm and mp3 require ffmpeg",
)
group.add_argument(
"--voice-language",
metavar="VOICE_LANGUAGE",
default="en",
help="Specify the language for voice using ISO 639-1 code (default: auto)",
)
return parser
@ -589,7 +749,6 @@ def get_md_help():
parser.formatter_class = MarkdownHelpFormatter
return argparse.ArgumentParser.format_help(parser)
return parser.format_help()
def get_sample_yaml():
@ -603,7 +762,6 @@ def get_sample_yaml():
parser.formatter_class = YamlHelpFormatter
return argparse.ArgumentParser.format_help(parser)
return parser.format_help()
def get_sample_dotenv():
@ -617,7 +775,6 @@ def get_sample_dotenv():
parser.formatter_class = DotEnvFormatter
return argparse.ArgumentParser.format_help(parser)
return parser.format_help()
def main():