Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,14 +25,14 @@ from langsmith import traceable
|
|
| 25 |
client = wrap_openai(openai.Client())
|
| 26 |
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
thread= client.beta.threads.create()
|
| 31 |
|
| 32 |
@traceable # Auto-trace this function
|
| 33 |
-
def
|
| 34 |
|
| 35 |
-
global
|
| 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=
|
| 47 |
|
| 48 |
)
|
| 49 |
|
|
@@ -60,7 +60,7 @@ def DisinformationAssistantRequest(text):
|
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
-
gr.Interface(fn=
|
| 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',
|