DreamStream-1 commited on
Commit
fd81908
·
verified ·
1 Parent(s): d4e1309

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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