Merge branch 'main' into shell-commands

This commit is contained in:
Paul Gauthier 2024-08-20 13:03:19 -07:00
commit 8b81d4fd45
8 changed files with 14 additions and 7 deletions

View file

@ -199,7 +199,7 @@ def get_parser(default_config_files, git_root):
"--map-tokens", "--map-tokens",
type=int, type=int,
default=None, default=None,
help="Max number of tokens to use for repo map, use 0 to disable (default: 1024)", help="Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)",
) )
group.add_argument( group.add_argument(
"--map-refresh", "--map-refresh",
@ -213,6 +213,12 @@ def get_parser(default_config_files, git_root):
default=False, default=False,
help="Enable caching of prompts (default: False)", help="Enable caching of prompts (default: False)",
) )
group.add_argument(
"--map-multiplier-no-files",
type=float,
default=2,
help="Multiplier for map tokens when no files are specified (default: 2)",
)
group.add_argument( group.add_argument(
"--max-chat-history-tokens", "--max-chat-history-tokens",
type=int, type=int,

View file

@ -537,6 +537,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
summarizer=summarizer, summarizer=summarizer,
map_refresh=args.map_refresh, map_refresh=args.map_refresh,
cache_prompts=args.cache_prompts, cache_prompts=args.cache_prompts,
map_mul_no_files=args.map_multiplier_no_files,
) )
except ValueError as err: except ValueError as err:
io.tool_error(str(err)) io.tool_error(str(err))

View file

@ -106,7 +106,7 @@ class RepoMap:
padding = 4096 padding = 4096
if max_map_tokens and self.max_context_window: if max_map_tokens and self.max_context_window:
target = min( target = min(
max_map_tokens * self.map_mul_no_files, int(max_map_tokens * self.map_mul_no_files),
self.max_context_window - padding, self.max_context_window - padding,
) )
else: else:

View file

@ -89,7 +89,7 @@
## Only work with models that have meta-data available (default: True) ## Only work with models that have meta-data available (default: True)
#show-model-warnings: true #show-model-warnings: true
## Max number of tokens to use for repo map, use 0 to disable (default: 1024) ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
#map-tokens: #map-tokens:
## Control how often the repo map is refreshed (default: auto) ## Control how often the repo map is refreshed (default: auto)

View file

@ -93,7 +93,7 @@
## Only work with models that have meta-data available (default: True) ## Only work with models that have meta-data available (default: True)
#AIDER_SHOW_MODEL_WARNINGS=true #AIDER_SHOW_MODEL_WARNINGS=true
## Max number of tokens to use for repo map, use 0 to disable (default: 1024) ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
#AIDER_MAP_TOKENS= #AIDER_MAP_TOKENS=
## Control how often the repo map is refreshed (default: auto) ## Control how often the repo map is refreshed (default: auto)

View file

@ -128,7 +128,7 @@ cog.outl("```")
## Only work with models that have meta-data available (default: True) ## Only work with models that have meta-data available (default: True)
#show-model-warnings: true #show-model-warnings: true
## Max number of tokens to use for repo map, use 0 to disable (default: 1024) ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
#map-tokens: #map-tokens:
## Control how often the repo map is refreshed (default: auto) ## Control how often the repo map is refreshed (default: auto)

View file

@ -135,7 +135,7 @@ cog.outl("```")
## Only work with models that have meta-data available (default: True) ## Only work with models that have meta-data available (default: True)
#AIDER_SHOW_MODEL_WARNINGS=true #AIDER_SHOW_MODEL_WARNINGS=true
## Max number of tokens to use for repo map, use 0 to disable (default: 1024) ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
#AIDER_MAP_TOKENS= #AIDER_MAP_TOKENS=
## Control how often the repo map is refreshed (default: auto) ## Control how often the repo map is refreshed (default: auto)

View file

@ -188,7 +188,7 @@ Aliases:
- `--no-show-model-warnings` - `--no-show-model-warnings`
### `--map-tokens VALUE` ### `--map-tokens VALUE`
Max number of tokens to use for repo map, use 0 to disable (default: 1024) Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)
Environment variable: `AIDER_MAP_TOKENS` Environment variable: `AIDER_MAP_TOKENS`
### `--map-refresh VALUE` ### `--map-refresh VALUE`