Tycohs commited on
Commit
d3bfd89
·
1 Parent(s): 0caaa9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -5,6 +5,8 @@ import time
5
  import os
6
  import re
7
  import time
 
 
8
 
9
  # Set up OpenAI API key
10
  system_message = "You are an assistant simulating the behavior of the participants in a focus group and answer a set of questions. Your first task will be to generate the profiles of the focus group then to simulate their answers to the question for each member."
@@ -426,7 +428,8 @@ Now please provide your results using the following language: {language}.
426
  #Now let's try 10 times
427
  for attempt in range(10):
428
  try:
429
- response = openai.ChatCompletion.create(
 
430
  model=model,
431
  messages=formmatedprompt
432
  )
 
5
  import os
6
  import re
7
  import time
8
+ from openai import OpenAI
9
+ client = OpenAI()
10
 
11
  # Set up OpenAI API key
12
  system_message = "You are an assistant simulating the behavior of the participants in a focus group and answer a set of questions. Your first task will be to generate the profiles of the focus group then to simulate their answers to the question for each member."
 
428
  #Now let's try 10 times
429
  for attempt in range(10):
430
  try:
431
+ #response = openai.ChatCompletion.create(
432
+ response = client.chat.completions.create(
433
  model=model,
434
  messages=formmatedprompt
435
  )