Skip to content

Commit

Permalink
Using deepseek example for streaming reasoning content
Browse files Browse the repository at this point in the history
  • Loading branch information
douglarek committed Feb 5, 2025
1 parent 78079b7 commit 959619f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ func main() {
content,
llms.WithMaxTokens(2000),
llms.WithTemperature(0.7),
llms.WithStreamingFunc(func(ctx context.Context, chunk []byte) error {
fmt.Print(string(chunk))
llms.WithStreamingReasoningFunc(func(ctx context.Context, reasoningChunk []byte, chunk []byte) error {
if len(reasoningChunk) > 0 {
fmt.Printf("Streaming Reasoning: %s\n", string(reasoningChunk))
}
if len(chunk) > 0 {
fmt.Printf("Streaming Content: %s\n", string(chunk))
}
return nil
}),
)
Expand Down

0 comments on commit 959619f

Please sign in to comment.