Spaces:
Sleeping
Sleeping
Commit
·
0370b8f
1
Parent(s):
adeca1f
Update bot.py
Browse files
bot.py
CHANGED
|
@@ -46,13 +46,13 @@ class supertec_bot:
|
|
| 46 |
|
| 47 |
self.client = openai.OpenAI(api_key=os.environ['openai_api_key'])
|
| 48 |
print(self.client)
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
|
| 57 |
|
| 58 |
|
|
@@ -72,7 +72,7 @@ class supertec_bot:
|
|
| 72 |
# Step 4: Run the Assistant
|
| 73 |
run = self.client.beta.threads.runs.create(
|
| 74 |
thread_id=thread.id,
|
| 75 |
-
assistant_id="
|
| 76 |
instructions=""
|
| 77 |
)
|
| 78 |
answer = None
|
|
|
|
| 46 |
|
| 47 |
self.client = openai.OpenAI(api_key=os.environ['openai_api_key'])
|
| 48 |
print(self.client)
|
| 49 |
+
Step 1: Create an Assistant
|
| 50 |
+
self.assistant = self.client.beta.assistants.create(
|
| 51 |
+
name="library Support Chatbot",
|
| 52 |
+
instructions="You are a a personal supertec chatbot that's highly tech-oriented and a part of the Rehan Foundation. Your primary job is to respond to user queries.",
|
| 53 |
+
tools=[function_balance],
|
| 54 |
+
model="gpt-3.5-turbo",
|
| 55 |
+
)
|
| 56 |
|
| 57 |
|
| 58 |
|
|
|
|
| 72 |
# Step 4: Run the Assistant
|
| 73 |
run = self.client.beta.threads.runs.create(
|
| 74 |
thread_id=thread.id,
|
| 75 |
+
assistant_id="self.assistant",
|
| 76 |
instructions=""
|
| 77 |
)
|
| 78 |
answer = None
|