Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,8 @@ import gradio as gr
|
|
2 |
import json, openai, os, time
|
3 |
from openai import OpenAI
|
4 |
|
|
|
|
|
5 |
def show_json(obj):
|
6 |
print("###")
|
7 |
print(json.loads(obj.model_dump_json()))
|
@@ -16,9 +18,7 @@ def wait_on_run(run, thread):
|
|
16 |
time.sleep(0.5)
|
17 |
return run
|
18 |
|
19 |
-
def chat(message, history):
|
20 |
-
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
|
21 |
-
|
22 |
assistant = client.beta.assistants.create(
|
23 |
name="Math Tutor",
|
24 |
instructions="You are a personal math tutor. Answer questions briefly, in a sentence or less.",
|
|
|
2 |
import json, openai, os, time
|
3 |
from openai import OpenAI
|
4 |
|
5 |
+
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
|
6 |
+
|
7 |
def show_json(obj):
|
8 |
print("###")
|
9 |
print(json.loads(obj.model_dump_json()))
|
|
|
18 |
time.sleep(0.5)
|
19 |
return run
|
20 |
|
21 |
+
def chat(message, history):
|
|
|
|
|
22 |
assistant = client.beta.assistants.create(
|
23 |
name="Math Tutor",
|
24 |
instructions="You are a personal math tutor. Answer questions briefly, in a sentence or less.",
|