Commit graph

10395 commits

Author SHA1 Message Date
Paul Gauthier
803423cc6a prettier /tokens output 2023-06-23 10:10:45 -07:00
Paul Gauthier
949a633e95 Handle complete context blowout more gracefully 2023-06-23 10:01:01 -07:00
Paul Gauthier
41b7a70347 fix test after merge 2023-06-23 07:55:03 -07:00
Paul Gauthier
fc6dd1877c Merge branch 'main' into edit-formats 2023-06-23 07:54:24 -07:00
Paul Gauthier
e261963acd fix for issue #25 2023-06-23 07:44:46 -07:00
Paul Gauthier
07ced21325 do not autocommit on dryrun 2023-06-22 19:22:53 -07:00
Paul Gauthier
15a0cdd6c9 aider: Added a --command,-c option to pass a string to coder.run().
# Context:
USER: add a --command,-c option which takes a string to pass to coder.run(with_message=args.command)
ASSISTANT: No changes are needed.
2023-06-22 19:02:22 -07:00
Paul Gauthier
cf3637dd5c roughed in run(with_message) 2023-06-22 18:55:23 -07:00
Paul Gauthier
208b3c2022 handle non-func replies 2023-06-22 18:33:22 -07:00
Paul Gauthier
4caec8dec1 reformat diff output header 2023-06-22 17:34:18 -07:00
Paul Gauthier
22a5e493a7 update files on the happy path 2023-06-22 17:32:34 -07:00
Paul Gauthier
82813d4159 rename modify_incremental_response -> render_incremental_response 2023-06-22 17:29:47 -07:00
Paul Gauthier
63f1c17a76 noop 2023-06-22 12:03:12 -07:00
Paul Gauthier
1c264eef67 noop 2023-06-22 12:03:04 -07:00
Paul Gauthier
8517681f02 Log the explanation to the chat history file 2023-06-22 12:01:34 -07:00
Paul Gauthier
3702ea3aa2 cleanup 2023-06-22 11:57:23 -07:00
Paul Gauthier
e8e2ea9d89 rename 2023-06-22 11:56:55 -07:00
Paul Gauthier
cc79f62498 repo_content_prefix = None in whole-func 2023-06-22 11:55:21 -07:00
Paul Gauthier
16a89fb5ab switch 3.5 models to use whole-func edit-format by default 2023-06-22 11:47:18 -07:00
Paul Gauthier
b5a92896ab Move the fname inside the unified diff block 2023-06-22 11:44:54 -07:00
Paul Gauthier
5043397848 respect --dry-run 2023-06-22 11:38:39 -07:00
Paul Gauthier
08764215c3 refac 2023-06-22 11:29:59 -07:00
Paul Gauthier
0f5264b196 renamed EditorPrompts -> CoderPrompts 2023-06-22 08:17:12 -07:00
Paul Gauthier
985e362544 renamed func -> wholefile_func 2023-06-22 08:15:20 -07:00
Paul Gauthier
fa1158d8a8 aider: Replaced MagicMock with custom mock_send function to set partial_response_content and return False in test_get_commit_message.
# Context:
USER: and test_get_commit_message
ASSISTANT: To make the requested change, modify the `test_get_commit_message` method in the `tests/test_coder.py` file as follows:

```python
tests/test_coder.py
<<<<<<< ORIGINAL
        # Mock the send method to return a tuple with a message and False
        coder.send = MagicMock(return_value=("a good commit message", False))
=======
        # Mock the send method to set partial_response_content and return False
        def mock_send(*args, **kwargs):
            coder.partial_response_content = "a good commit message"
            return False

        coder.send = MagicMock(side_effect=mock_send)
>>>>>>> UPDATED
```

This will replace the original `MagicMock` with a custom `mock_send` function that sets `coder.partial_response_content` to the desired commit message and returns `False`.
2023-06-21 21:39:47 -07:00
Paul Gauthier
cf25f3a3fe aider: Replaced MagicMock with custom mock_send function to set partial_response_content and return False in test_get_commit_message_no_strip_unmatched_quotes.
# Context:
USER: same for test_get_commit_message_no_strip_unmatched_quotes
ASSISTANT: To make the requested change, modify the `test_get_commit_message_no_strip_unmatched_quotes` method in the `tests/test_coder.py` file as follows:

```python
tests/test_coder.py
<<<<<<< ORIGINAL
        # Mock the send method to return a tuple with a message and False
        coder.send = MagicMock(return_value=('a good "commit message"', False))
=======
        # Mock the send method to set partial_response_content and return False
        def mock_send(*args, **kwargs):
            coder.partial_response_content = 'a good "commit message"'
            return False

        coder.send = MagicMock(side_effect=mock_send)
>>>>>>> UPDATED
```

This will replace the original `MagicMock` with a custom `mock_send` function that sets `coder.partial_response_content` to the desired commit message and returns `False`.
2023-06-21 21:39:20 -07:00
Paul Gauthier
9c79cbbadf aider: Set coder.partial_response_content to the good commit message in test_get_commit_message_strip_quotes.
# Context:
USER: in `test_get_commit_message_strip_quotes`, the coder.send call needs to just return False. it needs to set coder.partial_response_content= the good commit msg
ASSISTANT: To make the requested change, modify the `test_get_commit_message_strip_quotes` method in the `tests/test_coder.py` file as follows:

```python
tests/test_coder.py
<<<<<<< ORIGINAL
        # Mock the send method to return a tuple with a message and False
        coder.send = MagicMock(return_value=('"a good commit message"', False))
=======
        # Mock the send method to set partial_response_content and return False
        def mock_send(*args, **kwargs):
            coder.partial_response_content = "a good commit message"
            return False

        coder.send = MagicMock(side_effect=mock_send)
>>>>>>> UPDATED
```

This will replace the original `MagicMock` with a custom `mock_send` function that sets `coder.partial_response_content` to the desired commit message and returns `False`.
2023-06-21 21:38:38 -07:00
Paul Gauthier
2edbaa6e7a fixed tests 2023-06-21 21:36:36 -07:00
Paul Gauthier
0aafff4bc5 fixed tests 2023-06-21 21:35:50 -07:00
Paul Gauthier
4b69e2b85c fixed test 2023-06-21 21:33:51 -07:00
Paul Gauthier
e26acbae65 Make functions optional 2023-06-21 21:22:24 -07:00
Paul Gauthier
dd71b903a0 err msg 2023-06-21 21:18:16 -07:00
Paul Gauthier
eb062cc504 refac and func update_files 2023-06-21 21:17:12 -07:00
Paul Gauthier
8c1e1c7267 handle not live case 2023-06-21 21:08:22 -07:00
Paul Gauthier
f9086e66d3 better live output of multi file edits 2023-06-21 21:02:07 -07:00
Paul Gauthier
f187cf0346 live view of multiple file edits 2023-06-21 20:49:16 -07:00
Paul Gauthier
3a38e176d1 Updated parse_partial_args 2023-06-21 19:30:21 -07:00
Paul Gauthier
c14c92474f prompt 2023-06-21 19:27:48 -07:00
Paul Gauthier
04d0f95af9 new json schema for multi-file edits 2023-06-21 19:18:25 -07:00
Paul Gauthier
25444bbe9e aider: Modified schema to wrap "array" type inside an "object" type with a single property called "items".
# Context:
USER: I did `git reset --hard HEAD~1` to discard the last edits.
ASSISTANT: Alright, the last commit has been discarded. If you need any further assistance or want to make any other changes, feel free to ask.
USER: openai.error.InvalidRequestError: Invalid schema for function 'write_file': schema must be a JSON Schema of 'type: "object"', got 'type: "array"'.
ASSISTANT: I apologize for the confusion. It seems that the schema must be of type "object" instead of "array". In this case, we can modify the schema to have a single property that contains the list of objects. Here's the updated schema:

```python
aider/coders/func_coder.py
<<<<<<< ORIGINAL
            parameters=dict(
                type="object",
                required=["explanation", "file_path", "file_content"],
                properties=dict(
                    explanation=dict(
                        type="string",
                        description=(
                            "Explanation of the changes to be made to the code (markdown format)"
                        ),
                    ),
                    file_path=dict(
                        type="string",
                        description="Path of file to write",
                    ),
                    file_content=dict(
                        type="string",
                        description="Content to write to the file",
                    ),
                ),
            ),
=======
            parameters=dict(
                type="object",
                properties=dict(
                    items=dict(
                        type="array",
                        items=dict(
                            type="object",
                            required=["explanation", "file_path", "file_content"],
                            properties=dict(
                                explanation=dict(
                                    type="string",
                                    description=(
                                        "Explanation of the changes to be made to the code (markdown format)"
                                    ),
                                ),
                                file_path=dict(
                                    type="string",
                                    description="Path of file to write",
                                ),
                                file_content=dict(
                                    type="string",
                                    description="Content to write to the file",
                                ),
                            ),
                        ),
                    ),
                ),
            ),
>>>>>>> UPDATED
```

This change wraps the "array" type inside an "object" type with a single property called "items".
2023-06-21 19:11:05 -07:00
Paul Gauthier
0fda0ebb84 basic live rendering of func args 2023-06-21 19:05:53 -07:00
Paul Gauthier
8b50cc7606 Merge branch 'main' into edit-formats 2023-06-21 18:52:14 -07:00
Paul Gauthier
caad2af7e6 copy 2023-06-21 18:51:47 -07:00
Paul Gauthier
1f8ce95dfa refac 2023-06-21 18:50:06 -07:00
Paul Gauthier
1c53bff5ca Merge branch 'main' into edit-formats 2023-06-21 18:44:25 -07:00
Paul Gauthier
b1693fc0be copy 2023-06-21 18:43:37 -07:00
Paul Gauthier
9303827c9f copy 2023-06-21 18:43:07 -07:00
Paul Gauthier
29787270c8 copy 2023-06-21 18:42:36 -07:00
Paul Gauthier
c268eb94a6 copy 2023-06-21 18:41:54 -07:00
Paul Gauthier
6c07f5e4fd Merge branch 'main' into edit-formats 2023-06-21 18:40:12 -07:00