StreamResponse with Middleware
Hello, everyone. If you have rich experience in streaming communication in asp.net, I hope your help. Thank you.
6 Replies
But I can't know exact reason why it doesn't work.
If anybody has experience with it, I'll appreciate it if you help me.
Thank you.
$paste your code on a paste site so it's much easier to read
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
https://paste.mod.gg/bkbctmxjuvri/0 : program.cs
https://paste.mod.gg/bkbctmxjuvri/1 : chatbotcontroller.cs
https://paste.mod.gg/bkbctmxjuvri/2 : cryptionmiddleware.cs
BlazeBin - bkbctmxjuvri
A tool for sharing your source code with the world!
BlazeBin - bkbctmxjuvri
A tool for sharing your source code with the world!
BlazeBin - bkbctmxjuvri
A tool for sharing your source code with the world!
The OpenAI interface works correctly.
And the writeasync function is calling each time correctly.
But the stream responsing is not working correctly.
I hope your help.
FYI the service scope is disposed before the stream from an action result is read through. I haven't read your code
You have to go lower level and write to the output stream directly
or buffer the stream in memory