mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-29 22:20:43 +00:00
terminate stream with "[DONE]" message
see https://platform.openai.com/docs/api-reference/chat/create#chat/create-stream
This commit is contained in:
parent
eb5190fdab
commit
e011328c4f
1 changed files with 1 additions and 0 deletions
|
@ -360,6 +360,7 @@ func chatEndpoint(cm *ConfigMerger, debug bool, loader *model.ModelLoader, threa
|
||||||
respData, _ := json.Marshal(resp)
|
respData, _ := json.Marshal(resp)
|
||||||
|
|
||||||
w.WriteString(fmt.Sprintf("data: %s\n\n", respData))
|
w.WriteString(fmt.Sprintf("data: %s\n\n", respData))
|
||||||
|
w.WriteString("data: [DONE]\n\n")
|
||||||
w.Flush()
|
w.Flush()
|
||||||
}))
|
}))
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue