Allow repo map to work with whole edit format, for weaker models with large context

This commit is contained in:
Paul Gauthier 2024-04-23 10:21:33 -07:00
parent 341228b543
commit f92aecbf7a
3 changed files with 10 additions and 4 deletions

View file

@ -204,7 +204,7 @@ class Coder:
self.verbose,
)
if map_tokens > 0:
if map_tokens > 0 and self.repo_map:
self.io.tool_output(f"Repo-map: using {map_tokens} tokens")
max_map_tokens = 2048
if map_tokens > max_map_tokens:
@ -212,8 +212,10 @@ class Coder:
f"Warning: map-tokens > {max_map_tokens} is not recommended as too much"
" irrelevant code can confuse GPT."
)
else:
elif not map_tokens:
self.io.tool_output("Repo-map: disabled because map_tokens == 0")
else:
self.io.tool_output("Repo-map: disabled")
for fname in self.get_inchat_relative_files():
self.io.tool_output(f"Added {fname} to the chat.")

View file

@ -41,3 +41,7 @@ Create a new file you MUST return a *file listing* which includes an appropriate
# this coder is not able to handle repo content
repo_content_prefix = None
repo_content_prefix = """Below here are summaries of files present in the user's git repository.
Do not propose changes to these files, they are *read-only*.
"""

View file

@ -129,8 +129,8 @@ MODEL_SETTINGS = [
"groq/llama3-70b-8192",
"diff",
weak_model_name="groq/llama3-8b-8192",
use_repo_map=True,
send_undo_reply=True,
use_repo_map=False,
send_undo_reply=False,
),
# Gemini
ModelSettings(