Commit graph

459 commits

Author SHA1 Message Date
Paul Gauthier
48fd67485c add a user message during --show-prompts 2024-05-08 13:49:38 -07:00
Paul Gauthier
f256b43043 wip 2024-05-08 13:35:34 -07:00
Paul Gauthier
9ff6770a04 refactored litellm to avoid duplicating workarounds 2024-05-08 08:05:15 -07:00
Paul Gauthier
1747525418 aider: Added max_chat_history_tokens as an explicit argument to the Coder.__init__ method and passed args.max_chat_history_tokens when creating the Coder instance in main().
# 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()`.
2024-05-06 09:25:04 -07:00
Paul Gauthier
250d89649b added test coverage #585 2024-05-02 13:01:41 -07:00
Paul Gauthier
4482c24d34 Restore proper default to io.yes #585 2024-05-02 12:47:16 -07:00
Paul Gauthier
254481408e aider: Implemented loading .env file specified by command line argument.
# Aider chat conversation:

USER: do the todo

ASSISTANT: To implement the TODO item in `aider/main.py` about loading a .env file, we can make the following changes:

1. Add the python-dotenv package to the imports.
2. Load the .env file specified by args.env_file using dotenv.load_dotenv().

Here are the *SEARCH/REPLACE* blocks to make those changes:

aider/main.py
```python
<<<<<<< SEARCH
import configparser
import os
import sys
from pathlib import Path

import git
import litellm
from streamlit.web import cli
=======
import configparser
import os
import sys
from pathlib import Path

import git
import litellm
from dotenv import load_dotenv
from streamlit.web import cli
>>>>>>> REPLACE
```

aider/main.py
```python
<<<<<<< SEARCH
    # todo: load .env using filename args.env_file
=======
    if args.env_file:
        load_dotenv(args.env_file)
>>>>>>> REPLACE
```

This will load the environment variables from the specified .env file, if provided via the `--env-file` command line argument.

Note: You'll need to install the `python-dotenv` package for this to work, e.g. via `pip install python-dotenv`.
2024-05-02 11:29:12 -07:00
Paul Gauthier
8cfdd36620 Added support for loading environment variables from a custom .env file. 2024-05-02 11:29:11 -07:00
Paul Gauthier
256a9a454c move cloning into Coder.create, summarize chat history if edit format changes 2024-04-30 17:31:58 -07:00
Paul Gauthier
8e9a00006b carry conversation history to switched model 2024-04-30 16:25:47 -07:00
Paul Gauthier
304856fc60 roughed in model switch 2024-04-30 16:22:13 -07:00
Paul Gauthier
050d35790e added /models cmd 2024-04-30 16:02:38 -07:00
Paul Gauthier
29f4d788a3 set streamlit config options 2024-04-29 10:19:22 -07:00
Paul Gauthier
ec9fac2500 simpler launch of streamlit 2024-04-28 14:48:40 -07:00
Paul Gauthier
73bad5250b hit control-c 2024-04-28 14:38:30 -07:00
Paul Gauthier
542c091cf3 Added --gui functionality 2024-04-28 14:08:25 -07:00
Paul Gauthier
15a50a6afc more refactor 2024-04-28 13:19:48 -07:00
Paul Gauthier
5a01ba70a6 refactored parser, args 2024-04-28 13:15:14 -07:00
Paul Gauthier
701103a9cc chat works, with commits and reflected messages 2024-04-27 08:09:13 -07:00
Paul Gauthier
d21de778ff announcements 2024-04-26 11:24:42 -07:00
Paul Gauthier
f9e122b9d7 Added --show-model-warnings 2024-04-23 12:15:37 -07:00
Paul Gauthier
89a7b3470a Use fq model name in --models search 2024-04-22 19:17:27 -07:00
Paul Gauthier
25b8d6fec8 Added --models 2024-04-22 18:45:20 -07:00
Paul Gauthier
6901f92f96 refac 2024-04-22 14:42:46 -07:00
Paul Gauthier
efd3c39e50 Better unknown model warnings 2024-04-22 14:09:08 -07:00
Paul Gauthier
a9925d58af Updated AZURE env assignments in main, docs 2024-04-22 09:45:06 -07:00
Paul Gauthier
6863b47e6a Check the environment inside Model 2024-04-20 08:09:17 -07:00
Paul Gauthier
e513174da4 Warn if litellm is not giving us good validate_environment() responses 2024-04-20 08:01:50 -07:00
Paul Gauthier
05cdd9f2ec rename 2024-04-19 15:20:41 -07:00
Paul Gauthier
f81b62dfea Added --require-model-info 2024-04-19 14:01:02 -07:00
Paul Gauthier
aac110f078 copy 2024-04-19 13:45:51 -07:00
Paul Gauthier
6cecbd02d6 Document new model support 2024-04-19 13:18:12 -07:00
Paul Gauthier
922559a15a Refactored error handling to display model name in case of unknown model. 2024-04-19 11:17:33 -07:00
Paul Gauthier
7ec4de865d Added --weak-model 2024-04-19 10:57:21 -07:00
Paul Gauthier
93bd187bf3 Added --opus 2024-04-18 17:09:43 -07:00
Paul Gauthier
93f4a46996 reorg 2024-04-18 09:29:26 -07:00
Paul Gauthier
79170839ee noop 2024-04-18 09:24:18 -07:00
Paul Gauthier
68888faa6f Configure model settings, adopt litellm bugfix 2024-04-18 09:22:32 -07:00
Paul Gauthier
c770fc4380 cleaned up client refs 2024-04-17 15:47:07 -07:00
Paul Gauthier
c9bb22d6d5 roughed in tokenizer, dropped openai, openrouter 2024-04-17 15:22:35 -07:00
Paul Gauthier
855e787175 removed skip-model-avail-check 2024-04-17 15:02:39 -07:00
Paul Gauthier
b0245d3930 rouged in litellm 2024-04-17 14:15:24 -07:00
Paul Gauthier
7699866802 Handle missing api key without exception #559 2024-04-15 12:29:49 -07:00
Paul Gauthier
5c10944054 Abstract the default model name so it applies to scripting #537 2024-04-11 06:42:38 -07:00
Paul Gauthier
7103029abb Only redact non-null values #505 2024-03-19 12:00:00 -07:00
Paul Gauthier
0f9efc881e catch configparser errors 2024-03-10 08:22:48 -07:00
Paul Gauthier
058c237a28 Use gpt4 turbo as the default model 2024-03-08 13:13:20 -08:00
Paul Gauthier
f565057ad4 Improved logic to check for git user name/email 2024-03-08 12:37:21 -08:00
Paul Gauthier
fbc3f38256 tweaked model args 2024-03-07 13:07:02 -08:00
Paul Gauthier
cd434cac5a New --35turbo switch and docs updates 2024-02-28 14:06:44 -08:00