mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
precise edit blocks prompting language
This commit is contained in:
parent
2c53c153b8
commit
9e64e7bb9d
2 changed files with 6 additions and 4 deletions
|
@ -32,10 +32,15 @@ some/dir/example.py
|
||||||
>>>>>>> UPDATED
|
>>>>>>> UPDATED
|
||||||
{fence[1]}
|
{fence[1]}
|
||||||
|
|
||||||
|
A program will parse the edit blocks you generate and replace the ORIGINAL lines with the UPDATED lines.
|
||||||
|
So edit blocks must be precise and unambiguous!
|
||||||
|
|
||||||
Every *edit block* must be fenced with {fence[0]}...{fence[1]} with the correct code language.
|
Every *edit block* must be fenced with {fence[0]}...{fence[1]} with the correct code language.
|
||||||
Every *edit block* must start with the full path! *NEVER* propose edit blocks for *read-only* files.
|
Every *edit block* must start with the full path! *NEVER* propose edit blocks for *read-only* files.
|
||||||
|
|
||||||
|
The ORIGINAL section must be an *exact set of sequential lines* from the file!
|
||||||
NEVER SKIP LINES in the ORIGINAL section!
|
NEVER SKIP LINES in the ORIGINAL section!
|
||||||
|
NEVER ELIDE LINES AND REPLACE THEM WITH A COMMENT!
|
||||||
NEVER OMIT ANY WHITESPACE in the ORIGINAL section!
|
NEVER OMIT ANY WHITESPACE in the ORIGINAL section!
|
||||||
|
|
||||||
Edits to different parts of a file each need their own *edit block*.
|
Edits to different parts of a file each need their own *edit block*.
|
||||||
|
|
|
@ -13,7 +13,7 @@ from openai.error import (
|
||||||
Timeout,
|
Timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
CACHE_PATH = ".aider.send.cache.v1"
|
CACHE_PATH = "~/.aider.send.cache.v1"
|
||||||
CACHE = Cache(CACHE_PATH)
|
CACHE = Cache(CACHE_PATH)
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,11 +54,8 @@ def send_with_retries(model, messages, functions, stream):
|
||||||
hash_object = hashlib.sha1(key)
|
hash_object = hashlib.sha1(key)
|
||||||
|
|
||||||
if not stream and key in CACHE:
|
if not stream and key in CACHE:
|
||||||
print("hit", key)
|
|
||||||
return hash_object, CACHE[key]
|
return hash_object, CACHE[key]
|
||||||
|
|
||||||
print("miss", key)
|
|
||||||
|
|
||||||
res = openai.ChatCompletion.create(**kwargs)
|
res = openai.ChatCompletion.create(**kwargs)
|
||||||
|
|
||||||
if not stream:
|
if not stream:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue