Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document response stream chunk delimiter. #632

Merged
merged 4 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` a

All durations are returned in nanoseconds.

### Progress responses
JayNakrani marked this conversation as resolved.
Show resolved Hide resolved

Ollama streams progress responses for some of the endpoints. The progress response chunks are delineated with new-line (`\n`) delimiter.
JayNakrani marked this conversation as resolved.
Show resolved Hide resolved

## Generate a completion

```shell
Expand Down
1 change: 1 addition & 0 deletions server/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ func streamResponse(c *gin.Context, ch chan any) {
return false
}

// Delineate chunks with new-line delimiter
jmorganca marked this conversation as resolved.
Show resolved Hide resolved
bts = append(bts, '\n')
if _, err := w.Write(bts); err != nil {
log.Printf("streamResponse: w.Write failed with %s", err)
Expand Down