Skip to content

Commit ef07f11

Browse files
committed
#281: They run AI model's but can't support the full json schema spec, shame
1 parent 388b005 commit ef07f11

2 files changed

Lines changed: 8 additions & 20 deletions

File tree

aider/tools/insert_block.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ class Tool(BaseTool):
2222
"type": "function",
2323
"function": {
2424
"name": "InsertBlock",
25-
"description": "Insert a block of content into a file.",
25+
"description": (
26+
"Insert a block of content into a file. Only use one of: after_pattern,"
27+
" before_pattern, position."
28+
),
2629
"parameters": {
2730
"type": "object",
2831
"properties": {
@@ -38,20 +41,6 @@ class Tool(BaseTool):
3841
"use_regex": {"type": "boolean", "default": False},
3942
},
4043
"required": ["file_path", "content"],
41-
"oneOf": [
42-
{
43-
"required": ["after_pattern"],
44-
"not": {"required": ["before_pattern", "position"]},
45-
},
46-
{
47-
"required": ["before_pattern"],
48-
"not": {"required": ["after_pattern", "position"]},
49-
},
50-
{
51-
"required": ["position"],
52-
"not": {"required": ["after_pattern", "before_pattern"]},
53-
},
54-
],
5544
},
5645
},
5746
}

aider/tools/show_numbered_context.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ class Tool(BaseTool):
1515
"type": "function",
1616
"function": {
1717
"name": "ShowNumberedContext",
18-
"description": "Show numbered lines of context around a pattern or line number.",
18+
"description": (
19+
"Show numbered lines of context around a pattern or line number. Only use one of:"
20+
" pattern, line_number"
21+
),
1922
"parameters": {
2023
"type": "object",
2124
"properties": {
@@ -25,10 +28,6 @@ class Tool(BaseTool):
2528
"context_lines": {"type": "integer", "default": 3},
2629
},
2730
"required": ["file_path"],
28-
"oneOf": [
29-
{"required": ["pattern"], "not": {"required": ["line_number"]}},
30-
{"required": ["line_number"], "not": {"required": ["pattern"]}},
31-
],
3231
},
3332
},
3433
}

0 commit comments

Comments
 (0)