Skip to content

Commit

Permalink
docs: use async for instead of for for streaming FastAPI resp (in…
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki authored and PrathamSoni committed Apr 10, 2024
1 parent 022a72d commit 700371e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/concepts/fastapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def extract(data: UserData):
)

async def generate():
for user in users:
async for user in users:
resp_json = user.model_dump_json()
yield f"data: {resp_json}"
yield "data: [DONE]"
Expand Down

0 comments on commit 700371e

Please sign in to comment.