davidlopez commited on
Commit
cafb625
·
verified ·
1 Parent(s): 35941ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -25,14 +25,14 @@ from langsmith import traceable
25
  client = wrap_openai(openai.Client())
26
 
27
 
28
- DisinformationAssistant = client.beta.assistants.retrieve(os.getenv('OPENAI_ASSISTANT_ID'))
29
 
30
  thread= client.beta.threads.create()
31
 
32
  @traceable # Auto-trace this function
33
- def DisinformationAssistantRequest(text):
34
 
35
- global DisinformationAssistant
36
  global thread
37
  message = client.beta.threads.messages.create(
38
  thread_id=thread.id,
@@ -43,7 +43,7 @@ def DisinformationAssistantRequest(text):
43
 
44
  run = client.beta.threads.runs.create_and_poll(
45
  thread_id=thread.id,
46
- assistant_id=DisinformationAssistant.id
47
 
48
  )
49
 
@@ -60,7 +60,7 @@ def DisinformationAssistantRequest(text):
60
 
61
 
62
 
63
- gr.Interface(fn=DisinformationAssistantRequest,
64
  inputs=["text"],
65
  outputs=["text"],
66
  flagging_mode='never',
 
25
  client = wrap_openai(openai.Client())
26
 
27
 
28
+ FakeNewsAggregator = client.beta.assistants.retrieve(os.getenv('OPENAI_ASSISTANT_ID'))
29
 
30
  thread= client.beta.threads.create()
31
 
32
  @traceable # Auto-trace this function
33
+ def FakeNewsAggregatorRequest(text):
34
 
35
+ global FakeNewsAggregator
36
  global thread
37
  message = client.beta.threads.messages.create(
38
  thread_id=thread.id,
 
43
 
44
  run = client.beta.threads.runs.create_and_poll(
45
  thread_id=thread.id,
46
+ assistant_id=FakeNewsAggregator.id
47
 
48
  )
49
 
 
60
 
61
 
62
 
63
+ gr.Interface(fn=FakeNewsAggregatorRequest,
64
  inputs=["text"],
65
  outputs=["text"],
66
  flagging_mode='never',