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 traceback
from collections import defaultdict
from datetime import datetime
from json.decoder import JSONDecodeError
from pathlib import Path
@ -733,9 +734,16 @@ class Coder:
def fmt_system_prompt(self, prompt):
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
platform_text = (
f"The user's system is `{platform.platform()}` according to python platform.platform()"
)
platform_text = f"- The user's system: {platform.platform()}\n"
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(
fence=self.fence,