aider/aider
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
..
coders aider: Modified schema to wrap "array" type inside an "object" type with a single property called "items". 2023-06-21 19:11:05 -07:00
__init__.py version bump to 0.6.6 2023-06-17 07:27:17 -07:00
commands.py Merge branch 'main' into edit-formats 2023-06-21 14:55:18 -07:00
diffs.py aider: Updated diff_partial_update function to include 5 lines of context in unified_diff function call. 2023-06-06 18:13:36 -07:00
dump.py isort 2023-05-28 22:47:38 -07:00
io.py Fix issue with quoting /commands 2023-06-05 11:49:27 -07:00
main.py Added manual control of --edit-format 2023-06-21 12:12:12 -07:00
models.py Merge branch 'main' into edit-formats 2023-06-21 14:14:28 -07:00
prompts.py refactor Editors 2023-06-20 16:26:00 -07:00
repomap.py Improve messaging about universal ctags 2023-06-14 16:12:51 -07:00
utils.py refac 2023-06-20 17:04:06 -07:00