From 38eeba5bd2d626b508b62096454c5f6079c15e30 Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Mon, 11 Nov 2024 10:52:59 -0800 Subject: [PATCH] set maxcompletiontokens (#1260) --- pkg/waveai/waveai.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/waveai/waveai.go b/pkg/waveai/waveai.go index 360167b8c..dbf7775ee 100644 --- a/pkg/waveai/waveai.go +++ b/pkg/waveai/waveai.go @@ -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