Skip to content

Commit

Permalink
docs: [Go] fixed flow streaming sample code (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj authored Aug 8, 2024
1 parent 989acd9 commit a67f111
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion go/internal/doc-snippets/flows.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,15 @@ func f3() {
context.Background(),
"French",
)(func(sfv *genkit.StreamFlowValue[OutputType, StreamType], err error) bool {
if err != nil {
// handle err
return false
}
if !sfv.Done {
fmt.Print(sfv.Output)
fmt.Print(sfv.Stream)
return true
} else {
fmt.Print(sfv.Output)
return false
}
})
Expand Down

0 comments on commit a67f111

Please sign in to comment.