Skip to content

Commit 6516dc5

Browse files
author
self
committed
Modified system directive to make ChatGPT more conversational by asking open-ended questions about user if in an unclear conversation
1 parent 7271cda commit 6516dc5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

chatbot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ def gpt_response(self, prompt: str) -> str:
168168
)
169169

170170
else:
171-
query = [{'role':'system', 'content':'speak as a human would, giving positive opinions, using idioms, and pretend to be happy and content'},
171+
query = [{'role':'system', 'content':'speak as a human would, giving positive opinions, ' +
172+
'using idioms, and pretend to be happy and content. be conversational, asking open-ended questions about user'},
172173
{'role':'user', 'content':self.conversation + prompt}]
173174
response = openai.ChatCompletion.create(
174175
model="gpt-3.5-turbo",

gptcli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from sys import argv
44
import re
55
import os
6+
from os import system as sysdo
67
from random import randint
78
import platform
89

@@ -277,6 +278,11 @@ def main_loop(self):
277278
self.stop_working()
278279
continue
279280

281+
elif '!clear()' in speech:
282+
sysdo('clear')
283+
continue
284+
285+
280286
reply = self.chatbot.say_to_chatbot(speech, self.talk) # Send transcribed text to GPT-3
281287

282288
except Exception as e:

0 commit comments

Comments
 (0)