Commit graph

162 commits

Author SHA1 Message Date
Paul Gauthier
bc06d8623c Updated lint command to commit after fixing problems. 2024-05-18 19:30:32 -07:00
Paul Gauthier
04084883e8 Added a new command to run the linter on dirty files, fix problems, and then commit. 2024-05-18 18:35:33 -07:00
Paul Gauthier
72613f3b27 switch naming from openai/gpt-4o to gpt-4o 2024-05-15 06:25:30 -07:00
Paul Gauthier
b2fbafe41b docs and --4-turbo updates 2024-05-13 11:24:52 -07:00
Paul Gauthier
ea05cf05e1 Added --restore-chat-history 2024-05-13 11:09:28 -07:00
Paul Gauthier
bfba56c5f1 added 4o as default 2024-05-13 10:57:26 -07:00
paul-gauthier
45b2ba8a10
Merge pull request #591 from paul-gauthier/restore-chat-history
Restore prior chat history on launch
2024-05-11 07:49:43 -07:00
Paul Gauthier
f256b43043 wip 2024-05-08 13:35:34 -07:00
Paul Gauthier
3a79b6230b aider: Added a --max-chat-history-tokens switch and passed it to ChatSummary in Coder.
# Aider chat conversation:

USER: add a --max-chat-history-tokens switch, pass it into Coder to `ChatSummary`

ASSISTANT: Here are the changes to add a --max-chat-history-tokens switch and pass it to ChatSummary in Coder:

aider/args.py
```python
<<<<<<< SEARCH
    parser.add_argument(
        "--map-tokens",
        type=int,
        default=1024,
        help="Number of tokens to use for the repo map. Set to 0 to disable.",
    )
=======
    parser.add_argument(
        "--map-tokens",
        type=int,
        default=1024,
        help="Number of tokens to use for the repo map. Set to 0 to disable.",
    )
    parser.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.",
    )
>>>>>>> REPLACE
```

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
        self.summarizer = ChatSummary(
            self.main_model.weak_model,
            self.main_model.max_chat_history_tokens,
        )
=======
        max_chat_history_tokens = self.main_model.max_chat_history_tokens
        if kwargs.get("max_chat_history_tokens") is not None:
            max_chat_history_tokens = kwargs["max_chat_history_tokens"]

        self.summarizer = ChatSummary(
            self.main_model.weak_model,
            max_chat_history_tokens,
        )
>>>>>>> REPLACE
```

aider/main.py
```python
<<<<<<< SEARCH
            map_tokens=args.map_tokens,
=======
            map_tokens=args.map_tokens,
            max_chat_history_tokens=args.max_chat_history_tokens,
>>>>>>> REPLACE
```

This adds the new command line argument `--max-chat-history-tokens` which defaults to None. If not specified, it will use the model's default `max_chat_history_tokens`.

It passes this argument from `main()` into the `Coder` constructor.

In the `Coder` constructor, it checks if `max_chat_history_tokens` was provided in the `kwargs`. If so, it uses that value, otherwise it falls back to the model's default.

Let me know if you have any other questions!

ASSISTANT: Here are the changes to add a --max-chat-history-tokens switch and pass it to ChatSummary in Coder:

aider/args.py
```python
<<<<<<< SEARCH
    parser.add_argument(
        "--map-tokens",
        type=int,
        default=1024,
        help="Number of tokens to use for the repo map. Set to 0 to disable.",
    )
=======
    parser.add_argument(
        "--map-tokens",
        type=int,
        default=1024,
        help="Number of tokens to use for the repo map. Set to 0 to disable.",
    )
    parser.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.",
    )
>>>>>>> REPLACE
```

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
        self.summarizer = ChatSummary(
            self.main_model.weak_model,
            self.main_model.max_chat_history_tokens,
        )
=======
        max_chat_history_tokens = self.main_model.max_chat_history_tokens
        if kwargs.get("max_chat_history_tokens") is not None:
            max_chat_history_tokens = kwargs["max_chat_history_tokens"]

        self.summarizer = ChatSummary(
            self.main_model.weak_model,
            max_chat_history_tokens,
        )
>>>>>>> REPLACE
```

aider/main.py
```python
<<<<<<< SEARCH
            map_tokens=args.map_tokens,
=======
            map_tokens=args.map_tokens,
            max_chat_history_tokens=args.max_chat_history_tokens,
>>>>>>> REPLACE
```

This adds the new command line argument `--max-chat-history-tokens` which defaults to None. If not specified, it will use the model's default `max_chat_history_tokens`.

It passes this argument from `main()` into the `Coder` constructor.

In the `Coder` constructor, it checks if `max_chat_history_tokens` was provided in the `kwargs`. If so, it uses that value, otherwise it falls back to the model's default.

Let me know if you have any other questions!

USER: InvalidEditBlock: edit failed!

aider/args.py does not contain the *exact chunk* of SEARCH lines you specified.
Try again.
DO NOT skip blank lines, comments, docstrings, etc!
The SEARCH block needs to be EXACTLY the same as the lines in aider/args.py with nothing missing!

aider/args.py does not contain these 6 exact lines in a row:
```
    parser.add_argument(
        "--map-tokens",
        type=int,
        default=1024,
        help="Number of tokens to use for the repo map. Set to 0 to disable.",
    )
```

ASSISTANT: I apologize for the mistake. Here is the corrected change for aider/args.py:

aider/args.py
```python
<<<<<<< SEARCH
    group.add_argument(
        "--map-tokens",
        type=int,
        default=1024,
        help="Max number of tokens to use for repo map, use 0 to disable (default: 1024)",
    )
=======
    group.add_argument(
        "--map-tokens",
        type=int,
        default=1024,
        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.",
    )
>>>>>>> REPLACE
```
2024-05-06 09:23:37 -07:00
Paul Gauthier
d64a457def Added --env-file param 2024-05-02 11:32:06 -07:00
Paul Gauthier
542c091cf3 Added --gui functionality 2024-04-28 14:08:25 -07:00
Paul Gauthier
d889dfc879 added args.py 2024-04-28 13:25:31 -07:00