abdullahalioo commited on
Commit
7a83ce6
·
verified ·
1 Parent(s): 0183d99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -42,7 +42,11 @@ async def generate_response(prompt: str):
42
  if not prompt:
43
  raise HTTPException(status_code=400, detail="Prompt cannot be empty")
44
 
45
- return token
 
 
 
 
46
 
47
  def get_app():
48
  return app
 
42
  if not prompt:
43
  raise HTTPException(status_code=400, detail="Prompt cannot be empty")
44
 
45
+ return StreamingResponse(
46
+ response_with_token(),
47
+ media_type="text/event-stream",
48
+ headers={"X-Token": token} # Optionally include token in headers
49
+ )
50
 
51
  def get_app():
52
  return app