Commit graph

1071 commits

Author SHA1 Message Date
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
1f8ce95dfa refac 2023-06-21 18:50:06 -07:00
Paul Gauthier
ba6e2eeb63 wip 2023-06-21 18:05:49 -07:00
Paul Gauthier
82df52d855 Better error message 2023-06-21 14:36:01 -07:00
Paul Gauthier
684afd3242 catch ExhaustedContextWindow 2023-06-21 14:32:39 -07:00
Paul Gauthier
db47ac9f39 ExhaustedContextWindow 2023-06-21 14:31:03 -07:00
Paul Gauthier
ab6ef7eb5c wip 2023-06-21 14:05:23 -07:00
Paul Gauthier
2fce31209c wip 2023-06-21 13:57:42 -07:00
Paul Gauthier
3465bd57d1 roughed in func coder 2023-06-21 12:16:51 -07:00
Paul Gauthier
75e84017b3 Added manual control of --edit-format 2023-06-21 12:12:12 -07:00
Paul Gauthier
070f0a2919 refac 2023-06-20 17:46:47 -07:00
Paul Gauthier
e22373b55a refac 2023-06-20 17:41:56 -07:00
Paul Gauthier
0b45104da9 added default api_base 2023-06-20 17:14:52 -07:00
Paul Gauthier
c379cf3286 auto select edit mode 2023-06-20 17:13:26 -07:00
Paul Gauthier
5e63ce3352 refac 2023-06-20 17:04:06 -07:00
Paul Gauthier
f1350f169f refac 2023-06-20 16:59:55 -07:00
Paul Gauthier
02c9a30c45 refac 2023-06-20 16:47:37 -07:00
Paul Gauthier
bc38fcde65 aider: Called superclass's __init__ method before setting the gpt_prompts attribute in EditBlockCoder.
# Context:
USER: call super
ASSISTANT: To call the superclass's `__init__` method in the `EditBlockCoder` class, you need to modify the `aider/coders/editblock.py` file. Here's the change:

```python
aider/coders/editblock.py
<<<<<<< ORIGINAL
class EditBlockCoder(Coder):
    def __init__(self, *args, **kwargs):
        self.gpt_prompts = EditBlockPrompts()
=======
class EditBlockCoder(Coder):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.gpt_prompts = EditBlockPrompts()
>>>>>>> UPDATED
```

This change calls the superclass's `__init__` method before setting the `gpt_prompts` attribute.
2023-06-20 16:39:57 -07:00
Paul Gauthier
741249bb6b added editblockcoder 2023-06-20 16:39:31 -07:00
Paul Gauthier
602094aca3 refac 2023-06-20 16:35:56 -07:00