Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -281,12 +281,12 @@ class AdvancedRAG:
|
|
| 281 |
if not self.thread_id:
|
| 282 |
self.create_thread()
|
| 283 |
|
| 284 |
-
# Add the file to the thread
|
| 285 |
openai.beta.threads.messages.create(
|
| 286 |
thread_id=self.thread_id,
|
| 287 |
role="user",
|
| 288 |
content="I have uploaded a document. Please analyze it.",
|
| 289 |
-
attachments=[{"file_id": file_obj.id}]
|
| 290 |
)
|
| 291 |
|
| 292 |
return file_obj.id
|
|
|
|
| 281 |
if not self.thread_id:
|
| 282 |
self.create_thread()
|
| 283 |
|
| 284 |
+
# Add the file to the thread with the required tools field
|
| 285 |
openai.beta.threads.messages.create(
|
| 286 |
thread_id=self.thread_id,
|
| 287 |
role="user",
|
| 288 |
content="I have uploaded a document. Please analyze it.",
|
| 289 |
+
attachments=[{"file_id": file_obj.id, "tools": ["file_search"]}]
|
| 290 |
)
|
| 291 |
|
| 292 |
return file_obj.id
|