mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
fix: typecast fix for new ai library version
This commit is contained in:
parent
9014660dc3
commit
a2a5e5afdb
@ -190,7 +190,7 @@ func RunCompletionStream(ctx context.Context, opts *sstore.OpenAIOptsType, promp
|
|||||||
pk := packet.MakeOpenAIPacket()
|
pk := packet.MakeOpenAIPacket()
|
||||||
pk.Index = choice.Index
|
pk.Index = choice.Index
|
||||||
pk.Text = choice.Delta.Content
|
pk.Text = choice.Delta.Content
|
||||||
pk.FinishReason = choice.FinishReason
|
pk.FinishReason = string(choice.FinishReason)
|
||||||
rtn <- pk
|
rtn <- pk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ func marshalResponse(resp openaiapi.ChatCompletionResponse) []*packet.OpenAIPack
|
|||||||
choicePk := packet.MakeOpenAIPacket()
|
choicePk := packet.MakeOpenAIPacket()
|
||||||
choicePk.Index = choice.Index
|
choicePk.Index = choice.Index
|
||||||
choicePk.Text = choice.Message.Content
|
choicePk.Text = choice.Message.Content
|
||||||
choicePk.FinishReason = choice.FinishReason
|
choicePk.FinishReason = string(choice.FinishReason)
|
||||||
rtn = append(rtn, choicePk)
|
rtn = append(rtn, choicePk)
|
||||||
}
|
}
|
||||||
return rtn
|
return rtn
|
||||||
|
Loading…
Reference in New Issue
Block a user