yashxx07 commited on
Commit
7385806
·
verified ·
1 Parent(s): f59d018

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -2
main.py CHANGED
@@ -75,13 +75,18 @@ async def root(item: Item):
75
  }):
76
  # Yield the event as a string
77
  yield str(event)
 
78
 
79
  # Use StreamingResponse to stream the events
80
- return StreamingResponse(event_generator())
81
 
82
  except requests.RequestException as e:
83
  return {"error": str(e), "status_code": 500}
84
-
 
 
 
 
85
  @app.post("/extract-content")
86
  async def root(item: Item):
87
 
 
75
  }):
76
  # Yield the event as a string
77
  yield str(event)
78
+ print(str(event), end="")
79
 
80
  # Use StreamingResponse to stream the events
81
+ return StreamingResponse(event_generator(), media_type='text/event-stream')
82
 
83
  except requests.RequestException as e:
84
  return {"error": str(e), "status_code": 500}
85
+
86
+
87
+
88
+
89
+
90
  @app.post("/extract-content")
91
  async def root(item: Item):
92