Commit graph

769 commits

Author SHA1 Message Date
Paul Gauthier
b7f8687679 more platform info 2024-07-06 15:37:59 -03:00
Paul Gauthier
143e05ec66 include the users platform 2024-07-05 17:03:26 -03:00
Paul Gauthier
500cc151a1 Merge branch 'main' into help 2024-07-05 13:29:01 -03:00
Paul Gauthier
5122121265 allow multiple undo 2024-07-05 13:19:37 -03:00
Paul Gauthier
af48cc3e4c wip 2024-07-04 16:06:12 -03:00
Paul Gauthier
9f39c8db44 added HelpCoder 2024-07-04 14:29:19 -03:00
Paul Gauthier
9d02628cf8 streamlit borks sys.path, causes import("litellm") to load our litellm.py; fix 2024-07-03 21:32:50 -03:00
Paul Gauthier (aider)
790c2f0330 Implemented a more robust method to determine the image file type using the mimetypes module in the get_images_message function. 2024-07-03 16:16:23 -03:00
Paul Gauthier
0ef842dd53 Implemented a temporary solution to convert file names to media types for image files. 2024-07-03 16:15:04 -03:00
Paul Gauthier
ed35af44b3 defer numpy, bs4 and jsonschema 2024-07-03 13:35:33 -03:00
Paul Gauthier
7a3b0d6ddb handle oserrors when enumerating repo files #780 2024-07-02 19:59:03 -03:00
Paul Gauthier
16856bb4ca Give the commit message model the chat context #748 2024-06-30 13:02:23 -07:00
Paul Gauthier
85ef60f083 Try and avoid seaming errors when asking Sonnet to continue 2024-06-29 17:01:31 -07:00
Paul Gauthier
1a455e799e cleanup mdstream 2024-06-29 08:36:36 -07:00
Paul Gauthier
a84dca870e fix test for windows 2024-06-28 18:09:01 -07:00
Paul Gauthier
6f1e26157e fix test for windows 2024-06-28 17:09:08 -07:00
Paul Gauthier
307cfb2f44 fix so tests pass 2024-06-28 15:30:16 -07:00
Paul Gauthier
e7aa10a89b refac 2024-06-28 15:27:17 -07:00
Paul Gauthier
d6467a8e30 keep markdown stream open across multi response content 2024-06-28 15:10:20 -07:00
Paul Gauthier
e3805350c9 Added can_prefill metadata to the anthropic models 2024-06-27 15:22:16 -07:00
Paul Gauthier
044617b1b7 continue roughly working using anthropic's prefill 2024-06-27 14:40:46 -07:00
Paul Gauthier (aider)
ec682fd683 Added an option to prefix commit messages with 'aider: '. 2024-06-27 10:22:27 -07:00
Paul Gauthier
965c35870c Notice if the user mentions the basename of a filename; fixes to repomap context 2024-06-24 15:12:58 -07:00
Paul Gauthier
716e4d99a0 ensure the LLM response is logged even if token limits reached #705 2024-06-23 16:22:05 -07:00
Paul Gauthier
ecb3d81055 Updated token error to reflect that token counts can be approximate 2024-06-23 16:19:04 -07:00
Paul Gauthier
c207c7839a Added --attribute-author/committer options #698 2024-06-21 17:14:21 -07:00
Paul Gauthier
fb26174357 print token counts with commas 2024-06-20 16:17:13 -07:00
Paul Gauthier
5a3627de6e finish removing aider: prefix 2024-06-18 08:37:13 -07:00
paul-gauthier
a596a32290
Merge pull request #631 from daniel-vainsencher/dvf_llm_log 2024-06-17 13:58:46 -07:00
Paul Gauthier
a30e656304 improved token limit err msgs and docs #678 2024-06-14 07:28:33 -07:00
Daniel Vainsencher
3e9f6dcca2
Merge branch 'main' into dvf_llm_log 2024-06-12 18:32:48 -04:00
Daniel Vainsencher
c40b3fa310 Review comments 2024-06-12 18:28:55 -04:00
Paul Gauthier
6216a273fe drop context at the caller 2024-06-11 13:33:46 -07:00
Paul Gauthier
d2b9eec3e0 fixed bad url; fixed max_reflection logic 2024-06-08 12:57:36 -07:00
Paul Gauthier
1f1da4b1a2 refac all urls into urls.py 2024-06-08 12:53:54 -07:00
Paul Gauthier
09d3d02971 more conservative reflection if 2024-06-08 12:40:35 -07:00
Daniel Vainsencher
e6e360a4ef Added support for logging LLM history to a specified file. 2024-06-07 10:40:32 -04:00
Daniel Vainsencher
8896909e19 aider: Capitalize the "ASSISTANT" role when logging to the LLM history file.
# Aider chat conversation:

USER: When logging to llm history file, capitalize the ASSISTANT role.

ASSISTANT: To capitalize the "ASSISTANT" role when logging to the LLM history file, we need to modify the `send_new_user_message` method in `aider/coders/base_coder.py`.

Here is the *SEARCH/REPLACE* block:

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
        with open('.aider.llm.history', 'a') as log_file:
            log_file.write(f"LLM RESPONSE {timestamp}\n")
            log_file.write(format_content("assistant", content) + "\n")
=======
        with open('.aider.llm.history', 'a') as log_file:
            log_file.write(f"LLM RESPONSE {timestamp}\n")
            log_file.write(format_content("ASSISTANT", content) + "\n")
>>>>>>> REPLACE
```
2024-06-07 09:39:03 -04:00
Daniel Vainsencher
2bd5daf2ad aider: Add logging of conversation between coder and LLM in .aider.llm.history file using new formatting functions in send_new_user_message.
# Aider chat conversation:

USER: We want to add logging of the conversation between coder and the LLM into a new file called .aider.llm.history. The formatting should be done using the new format_messages and format_content. Modify only the `send_new_user_message` function in base_coder, formatting and logging `messages` as soon as it is defined, and logging `content` before `tool_output`. Precede them by a single line saying "TO LLM {timestamp}" and "LLM RESPONSE {timestamp}" where the timestamp is uses ISO date format and has second precision.

ASSISTANT: To implement the logging of the conversation between the coder and the LLM, we will:

1. Format and log `messages` as soon as it is defined in `send_new_user_message`.
2. Log `content` before `tool_output`.
3. Precede the logs with a timestamp in ISO date format with second precision.

Here are the *SEARCH/REPLACE* blocks:

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
        messages = self.format_messages()
=======
        import datetime
        from aider.utils import format_messages, format_content

        messages = self.format_messages()

        timestamp = datetime.datetime.now().isoformat(timespec='seconds')
        with open('.aider.llm.history', 'a') as log_file:
            log_file.write(f"TO LLM {timestamp}\n")
            log_file.write(format_messages(messages) + "\n")
>>>>>>> REPLACE
```

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
        self.io.tool_output()
=======
        self.io.tool_output()

        timestamp = datetime.datetime.now().isoformat(timespec='seconds')
        with open('.aider.llm.history', 'a') as log_file:
            log_file.write(f"LLM RESPONSE {timestamp}\n")
            log_file.write(format_content("assistant", content) + "\n")
>>>>>>> REPLACE
```
2024-06-07 09:39:03 -04:00
Paul Gauthier
52ac35fcd2 restore --show-diffs functionality #607 2024-05-23 14:07:20 -07:00
Paul Gauthier
6345cd3734 cleanup 2024-05-23 13:43:35 -07:00
Paul Gauthier
fb76895eb1 Merge branch 'main' into swe-bench 2024-05-23 13:36:23 -07:00
Paul Gauthier
a405defcff ask for confirmation 2024-05-22 21:27:59 -07:00
Paul Gauthier
5032adf44b Add the url content 2024-05-22 21:25:34 -07:00
Paul Gauthier
dc8ae596c3 aider: Implement regex to find all URLs in the input string.
# Aider chat conversation:

USER: do the todo

ASSISTANT: To address the TODO comment, we need to implement a regex to find all URLs in the input string. Here are the changes:

1. Import the `re` module for regular expressions.
2. Implement the `check_for_urls` method to find and process URLs in the input string.

Here are the *SEARCH/REPLACE* blocks:

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
import hashlib
=======
import hashlib
import re
>>>>>>> REPLACE
```

aider/coders/base_coder.py
```python
<<<<<<< SEARCH
        # todo use a regex to find all urls in inp

        return inp
=======
        url_pattern = re.compile(
            r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'
        )
        urls = url_pattern.findall(inp)
        if urls:
            self.io.tool_output(f"Found URLs: {', '.join(urls)}")
        return inp
>>>>>>> REPLACE
```

This will implement the functionality to find all URLs in the input string using a regular expression.
2024-05-22 21:19:44 -07:00
Paul Gauthier
aca24976a7 Add method to check for URLs in input. 2024-05-22 21:19:43 -07:00
Paul Gauthier
1effd73e80 Only expand the repomap if we know it will fit into context window 2024-05-20 10:22:57 -07:00
Paul Gauthier
fa0aa60c97 Merge branch 'main' into swe-bench 2024-05-20 09:39:29 -07:00
Paul Gauthier
9c28bbc98e Refactored linting process and error handling in commands. 2024-05-20 08:55:49 -07:00
Paul Gauthier
e758b01fb6 Merge branch 'main' into swe-bench 2024-05-19 15:20:46 -07:00