Update json endpoint
This commit is contained in:
parent
ed2bf02a58
commit
2f45d49ac0
|
@ -1,6 +1,6 @@
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from fastapi.responses import StreamingResponse
|
from fastapi.responses import StreamingResponse
|
||||||
from src.generators import conversation_streamer
|
from src.generators import conversation_streamer, json_streamer
|
||||||
|
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
@ -19,6 +19,7 @@ async def talk():
|
||||||
|
|
||||||
|
|
||||||
@router.get("/json")
|
@router.get("/json")
|
||||||
async def json_streamer():
|
async def json():
|
||||||
# Your solution here
|
return StreamingResponse(
|
||||||
pass
|
content=json_streamer(), media_type="text/event-stream"
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue