jadend commited on
Commit
222f176
·
1 Parent(s): 48f04e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -42,13 +42,13 @@ user_db = {
42
  # the OpenAI function to use the given prompt to the model defined.
43
  def mr_bot(premise, tokens, temperature):
44
  openai.api_key = os.environ["API_TOKEN"]
45
- response = openai.Completion.create(
46
- model="text-davinci-003",
47
- prompt=premise,
48
  max_tokens=tokens,
49
  temperature=temperature,
50
  )
51
- store_message(premise=premise, temperature=temperature, response=response['choices'][0]["text"])
52
 
53
  return response['choices'][0]["text"]
54
 
 
42
  # the OpenAI function to use the given prompt to the model defined.
43
  def mr_bot(premise, tokens, temperature):
44
  openai.api_key = os.environ["API_TOKEN"]
45
+ response = client.chat.completions.create(
46
+ model="gpt-3.5-turbo",
47
+ messages=[{"role": "user", "content": premise}],
48
  max_tokens=tokens,
49
  temperature=temperature,
50
  )
51
+ store_message(premise=premise, temperature=temperature, response=response['choices'][0]['message']['content']])
52
 
53
  return response['choices'][0]["text"]
54