From a2a5e5afdb2b47a55bccabf6305534f6d87ec9a4 Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Tue, 17 Sep 2024 14:12:24 -0700 Subject: [PATCH] fix: typecast fix for new ai library version --- wavesrv/pkg/remote/openai/openai.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wavesrv/pkg/remote/openai/openai.go b/wavesrv/pkg/remote/openai/openai.go index 4b060d2d..a8fb1654 100644 --- a/wavesrv/pkg/remote/openai/openai.go +++ b/wavesrv/pkg/remote/openai/openai.go @@ -190,7 +190,7 @@ func RunCompletionStream(ctx context.Context, opts *sstore.OpenAIOptsType, promp pk := packet.MakeOpenAIPacket() pk.Index = choice.Index pk.Text = choice.Delta.Content - pk.FinishReason = choice.FinishReason + pk.FinishReason = string(choice.FinishReason) rtn <- pk } } @@ -209,7 +209,7 @@ func marshalResponse(resp openaiapi.ChatCompletionResponse) []*packet.OpenAIPack choicePk := packet.MakeOpenAIPacket() choicePk.Index = choice.Index choicePk.Text = choice.Message.Content - choicePk.FinishReason = choice.FinishReason + choicePk.FinishReason = string(choice.FinishReason) rtn = append(rtn, choicePk) } return rtn