omdena-mental-health / appOpenAI.py
patti-j's picture
Rename app.py to appOpenAI.py
d8f8819
raw
history blame
550 Bytes
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
start_sequence = "\nAI:"
restart_sequence = "\nHuman: "
response = openai.Completion.create(
model="text-davinci-003",
prompt="The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.\n\nHuman: Hello, who are you?\nAI: I am an AI created by OpenAI. How can I help you today?\nHuman: \nAI:",
temperature=0.9,
max_tokens=150,
top_p=1,
frequency_penalty=0,
presence_penalty=0.6,
stop=[" Human:", " AI:"]
)