Merge pull request #5 from wunderwuzzi23/wunderwuzzi23/fix-prompt-issue
fix system prompt, add python-dotenv to requirements
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
openai==0.27
|
openai==0.27
|
||||||
termcolor==2.2.0
|
termcolor==2.2.0
|
||||||
colorama
|
colorama
|
||||||
|
python-dotenv
|
||||||
@@ -115,13 +115,12 @@ if __name__ == "__main__":
|
|||||||
print ("No user prompt specified.")
|
print ("No user prompt specified.")
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
|
||||||
# Load the correct prompt based on Shell and OS and append the user's prompt
|
# Load the correct prompt based on Shell and OS and append the user's prompt
|
||||||
prompt = get_full_prompt(user_prompt, shell)
|
prompt = get_full_prompt(user_prompt, shell)
|
||||||
|
|
||||||
# Make the first line also the system prompt
|
# Make the first line also the system prompt
|
||||||
system_prompt = prompt[1]
|
system_prompt = prompt.split("\n")[0]
|
||||||
|
|
||||||
# Call the ChatGPT API
|
# Call the ChatGPT API
|
||||||
response = openai.ChatCompletion.create(
|
response = openai.ChatCompletion.create(
|
||||||
model="gpt-3.5-turbo",
|
model="gpt-3.5-turbo",
|
||||||
|
|||||||
Reference in New Issue
Block a user