Spaces:
Sleeping
Sleeping
import os | |
import openai | |
openai.api_key = "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" | |
def helpTalk(input): | |
response = openai.Completion.create( | |
model="text-davinci-003", | |
prompt="Read the users input and respond in such a manner that user is bound to reply.\nInput : I am fine. \n\nOutput : That's great to hear! What happened?\n/#/#\nInput :", | |
temperature=0.7, | |
max_tokens=256, | |
top_p=1, | |
frequency_penalty=0, | |
presence_penalty=0, | |
stop=["/#/#"] | |
) | |
text = response["choices"][0]["text"] | |
return text |