Anustup commited on
Commit
25c5f60
·
verified ·
1 Parent(s): a7ba934

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -8,6 +8,9 @@ OPENAI_API_KEY = os.getenv("OPEN_AI_API_KEY")
8
  client = OpenAI(api_key=OPENAI_API_KEY)
9
  OPEN_AI_MODEL = "gpt-4-1106-preview"
10
 
 
 
 
11
 
12
  def wait_on_run(run, thread):
13
  while run.status == "queued" or run.status == "in_progress":
@@ -99,8 +102,7 @@ def response_evaluation_for_case_tx(thread_id, query, question_text, input, outp
99
 
100
 
101
  def run_chat_in_all_cases(message, history, question_text,input, output, examples, code_written):
102
- thread = client.beta.threads.create()
103
- thread_id = thread.id
104
  if not message and not code_written:
105
  ai_message = opening_statement(thread_id, question_text, input, output, examples, thread)
106
  if not code_written:
 
8
  client = OpenAI(api_key=OPENAI_API_KEY)
9
  OPEN_AI_MODEL = "gpt-4-1106-preview"
10
 
11
+ thread = gr.state(client.beta.threads.create())
12
+ # thread = client.beta.threads.create()
13
+ thread_id = thread.id
14
 
15
  def wait_on_run(run, thread):
16
  while run.status == "queued" or run.status == "in_progress":
 
102
 
103
 
104
  def run_chat_in_all_cases(message, history, question_text,input, output, examples, code_written):
105
+
 
106
  if not message and not code_written:
107
  ai_message = opening_statement(thread_id, question_text, input, output, examples, thread)
108
  if not code_written: