mirror of
https://github.com/marcominerva/SqlDatabaseVectorSearch.git
synced 2026-06-20 12:23:10 +00:00
Remove delay in /api/ask-streaming endpoint response
Eliminated the 50ms delay in the asynchronous streaming response logic of the /api/ask-streaming endpoint by removing the line `await Task.Delay(50);`. This change improves the response time by removing unnecessary latency after each delta in the response stream.
This commit is contained in:
@@ -151,7 +151,6 @@ app.MapPost("/api/ask-streaming", (Question question, VectorSearchService vector
|
|||||||
await foreach (var delta in responseStream)
|
await foreach (var delta in responseStream)
|
||||||
{
|
{
|
||||||
yield return delta;
|
yield return delta;
|
||||||
await Task.Delay(50);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user