mirror of
https://github.com/ollama/ollama.git
synced 2025-03-26 17:51:48 +01:00
use content type application/x-ndjson
for streaming responses
This commit is contained in:
parent
55cf5021f0
commit
cff002b824
@ -367,6 +367,7 @@ func Serve(ln net.Listener, extraOrigins []string) error {
|
||||
}
|
||||
|
||||
func streamResponse(c *gin.Context, ch chan any) {
|
||||
c.Header("Content-Type", "application/x-ndjson")
|
||||
c.Stream(func(w io.Writer) bool {
|
||||
val, ok := <-ch
|
||||
if !ok {
|
||||
|
Loading…
x
Reference in New Issue
Block a user