forked from sifywojtek/bababbaa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnikolaj
27 lines (21 loc) · 781 Bytes
/
nikolaj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import openai
def chatbot():
print("Hello, Operator - hint to start <3")
openai.api_key = "APIkey"
while True:
user_input = input("@: ")
if user_input.lower() == "quit":
print(".....<*);'.;,';,.;'.,;'.,;'.,.;'.,;'.,;'.,;'.,.(*>.......: Hehe, bai bumbble bee, I love ye, my nana to be. <3.")
break
else:
response = openai.Completion.create(
engine="text-davinci-003",
prompt='@: ' + user_input,
max_tokens=1024,
n=2,
stop=None,
temperature=0.5,
).choices[0].text
print(".....<*);'.;,';,.;'.,;'.,;'.,.;'.,;'.,;'.,;'.,.(*>.......: " + response)
if __name__ == "__main__":
chatbot()