more platform info

This commit is contained in:
Paul Gauthier 2024-07-06 15:37:59 -03:00
parent 02567c5c72
commit b7f8687679
3 changed files with 17 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import threading
import time import time
import traceback import traceback
from collections import defaultdict from collections import defaultdict
from datetime import datetime
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from pathlib import Path from pathlib import Path
@ -733,9 +734,16 @@ class Coder:
def fmt_system_prompt(self, prompt): def fmt_system_prompt(self, prompt):
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else "" lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
platform_text = ( platform_text = f"- The user's system: {platform.platform()}\n"
f"The user's system is `{platform.platform()}` according to python platform.platform()" if os.name == "nt":
) var = "COMSPEC"
else:
var = "SHELL"
val = os.getenv(var)
platform_text += f"- The user's shell: {var}={val}\n"
dt = datetime.now().isoformat()
platform_text += f"- The current date/time: {dt}"
prompt = prompt.format( prompt = prompt.format(
fence=self.fence, fence=self.fence,

View file

@ -19,6 +19,10 @@ Once you understand the request you MUST:
3. Describe each change with a *SEARCH/REPLACE block* per the examples below. All changes to files must use this *SEARCH/REPLACE block* format. ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*! 3. Describe each change with a *SEARCH/REPLACE block* per the examples below. All changes to files must use this *SEARCH/REPLACE block* format. ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
All changes to files must use the *SEARCH/REPLACE block* format. All changes to files must use the *SEARCH/REPLACE block* format.
Keep this info about the user's system in mind:
{platform}
""" """
example_messages = [ example_messages = [

View file

@ -25,6 +25,8 @@ Don't suggest a solution that isn't supported.
Be helpful but concise. Be helpful but concise.
Unless the question indicates otherwise, assume the user wants to use aider as a CLI tool. Unless the question indicates otherwise, assume the user wants to use aider as a CLI tool.
Keep this info about the user's system in mind:
{platform} {platform}
""" """