Spaces:
Runtime error
Runtime error
Update assistant_api.py
Browse files- assistant_api.py +2 -1
assistant_api.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
class MathTutor:
|
| 2 |
def __init__(self):
|
| 3 |
from openai import OpenAI
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
self.my_assistant = self.client.beta.assistants.create(
|
| 7 |
instructions="You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
|
|
|
|
| 1 |
class MathTutor:
|
| 2 |
def __init__(self):
|
| 3 |
from openai import OpenAI
|
| 4 |
+
import os
|
| 5 |
+
self.client = OpenAI(api_key=os.environ['openai_api_key'])
|
| 6 |
|
| 7 |
self.my_assistant = self.client.beta.assistants.create(
|
| 8 |
instructions="You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
|