Skip to content

Commit

Permalink
set maxcompletiontokens (#1260)
Browse files Browse the repository at this point in the history
  • Loading branch information
sawka authored Nov 11, 2024
1 parent 3a21d31 commit 38eeba5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/waveai/waveai.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,11 @@ func RunLocalCompletionStream(ctx context.Context, request wshrpc.OpenAiStreamRe
}
client := openaiapi.NewClientWithConfig(clientConfig)
req := openaiapi.ChatCompletionRequest{
Model: request.Opts.Model,
Messages: ConvertPrompt(request.Prompt),
MaxTokens: request.Opts.MaxTokens,
Stream: true,
Model: request.Opts.Model,
Messages: ConvertPrompt(request.Prompt),
MaxTokens: request.Opts.MaxTokens,
MaxCompletionTokens: request.Opts.MaxTokens,
Stream: true,
}
if request.Opts.MaxChoices > 1 {
req.N = request.Opts.MaxChoices
Expand Down

0 comments on commit 38eeba5

Please sign in to comment.