Skip to content

Commit 9c9f431

Browse files
committed
[gpt_cmd.py] Provide system OS and arch in first message
1 parent 42ea28d commit 9c9f431

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
```sh
99
gpt_cmd "Install python3 and pip3 and symlink them to python and pip"
1010

11-
gpt_cmd "You're running on an alpine linux distro that already has wget and bash installed. Install kafka"
11+
gpt_cmd "You're running in a container that already has wget and bash installed. Install kafka"
1212

1313
gpt_cmd "Install SQLite and write a script to verify it's working correctly"
1414
```

gpt_cmd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import datetime
22
import json
33
import os
4+
import platform
45
import subprocess
56
import sys
67
from openai import OpenAI
@@ -121,9 +122,10 @@ def prompt_user_yn(prompt):
121122
def main(goal):
122123
convo_timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
123124
convo_file_name = None
125+
system_info=f'System info:\nOS: {sys.platform}\nArchitecture: {platform.machine()}'
124126
messages = [
125127
{"role": "system", "content": SYSTEM_PROMPT},
126-
{"role": "user", "content": goal}
128+
{"role": "user", "content": f'{goal}\n{system_info}'}
127129
]
128130

129131
def save_convo():

0 commit comments

Comments
 (0)