mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
![]() # Aider chat conversation: USER: don't use kwargs, add it as an explicit arg ASSISTANT: Here is the *SEARCH/REPLACE block* to add `max_chat_history_tokens` as an explicit argument instead of using `**kwargs`: aider/coders/base_coder.py ```python <<<<<<< SEARCH def __init__( self, main_model, io, fnames=None, git_dname=None, pretty=True, show_diffs=False, auto_commits=True, dirty_commits=True, dry_run=False, map_tokens=1024, verbose=False, assistant_output_color="blue", code_theme="default", stream=True, use_git=True, voice_language=None, aider_ignore_file=None, cur_messages=None, done_messages=None, ): ======= def __init__( self, main_model, io, fnames=None, git_dname=None, pretty=True, show_diffs=False, auto_commits=True, dirty_commits=True, dry_run=False, map_tokens=1024, verbose=False, assistant_output_color="blue", code_theme="default", stream=True, use_git=True, voice_language=None, aider_ignore_file=None, cur_messages=None, done_messages=None, max_chat_history_tokens=None, ): >>>>>>> REPLACE ``` aider/main.py ```python <<<<<<< SEARCH coder = Coder.create( main_model=main_model, edit_format=args.edit_format, io=io, ## fnames=fnames, git_dname=git_dname, pretty=args.pretty, show_diffs=args.show_diffs, auto_commits=args.auto_commits, dirty_commits=args.dirty_commits, dry_run=args.dry_run, map_tokens=args.map_tokens, verbose=args.verbose, assistant_output_color=args.assistant_output_color, code_theme=args.code_theme, stream=args.stream, use_git=args.git, voice_language=args.voice_language, aider_ignore_file=args.aiderignore, ) ======= coder = Coder.create( main_model=main_model, edit_format=args.edit_format, io=io, ## fnames=fnames, git_dname=git_dname, pretty=args.pretty, show_diffs=args.show_diffs, auto_commits=args.auto_commits, dirty_commits=args.dirty_commits, dry_run=args.dry_run, map_tokens=args.map_tokens, verbose=args.verbose, assistant_output_color=args.assistant_output_color, code_theme=args.code_theme, stream=args.stream, use_git=args.git, voice_language=args.voice_language, aider_ignore_file=args.aiderignore, max_chat_history_tokens=args.max_chat_history_tokens, ) >>>>>>> REPLACE ``` This adds `max_chat_history_tokens` as an explicit argument to the `Coder.__init__` method, and passes `args.max_chat_history_tokens` when creating the `Coder` instance in `main()`. |
||
---|---|---|
.. | ||
coders | ||
queries | ||
__init__.py | ||
args.py | ||
commands.py | ||
diffs.py | ||
dump.py | ||
gui.py | ||
history.py | ||
io.py | ||
main.py | ||
mdstream.py | ||
models.py | ||
prompts.py | ||
repo.py | ||
repomap.py | ||
scrape.py | ||
sendchat.py | ||
utils.py | ||
versioncheck.py | ||
voice.py |