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