Skip to content

Commit

Permalink
fix: update the prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
brayo-pip committed Oct 8, 2024
1 parent ccc6d9b commit 60f5360
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gptme/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ def prompt_systeminfo() -> Generator[Message, None, None]:

def get_system_distro() -> str:
"""Get the system distribution name."""
regex = r"^NAME=\"([^\"]+)\""
regex = r"^NAME=\"?([^\"]+)\"?"

if os.path.exists("/etc/os-release"):
with open("/etc/os-release") as f:
for line in f:
match = re.match(regex, line)
if match:
return match.group(1)
return "unknown"
matches = re.search(regex, line)
if matches:
return matches.string[matches.start(1) : matches.end(1)]
return "Linux"

document_prompt_function(interactive=True)(prompt_gptme)
document_prompt_function()(prompt_user)
Expand Down

0 comments on commit 60f5360

Please sign in to comment.