Omkar008 commited on
Commit
81e9e89
·
verified ·
1 Parent(s): 77c54c0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -7
main.py CHANGED
@@ -22,14 +22,11 @@ client = Client(api_key=os.getenv('OPENAI_API_KEY'),organization=os.getenv('ORG_
22
  async def batch_processing_result(request: Request, background_tasks: BackgroundTasks):
23
  body = await request.json()
24
  batch_id = body.get('batch_job_id')
25
- batch_job = client.batches.retrieve(batch_id)
26
- # while batch_job.status == 'in_progress':
27
- batch_job = client.batches.retrieve(batch_id)
28
- print(batch_job.status)
29
  # Add the processing task to background tasks
30
- if batch_job.status == 'completed':
31
- background_tasks.add_task(process_batch_data, batch_id)
32
- return {"batch_job_status":'completed'}
33
 
34
  # Immediately return success response
35
  return {'batch_job_status':'notcompleted'}
 
22
  async def batch_processing_result(request: Request, background_tasks: BackgroundTasks):
23
  body = await request.json()
24
  batch_id = body.get('batch_job_id')
25
+
 
 
 
26
  # Add the processing task to background tasks
27
+ # if batch_job.status == 'completed':
28
+ # background_tasks.add_task(process_batch_data, batch_id)
29
+ # return {"batch_job_status":'completed'}
30
 
31
  # Immediately return success response
32
  return {'batch_job_status':'notcompleted'}