mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-16 13:13:41 +08:00
🐛 fix: repair the error caused by incomplete parameters in third-party OpenAI interface (#135)
This commit is contained in:
@@ -189,6 +189,14 @@ type ChatCompletionResponse struct {
|
||||
PromptFilterResults any `json:"prompt_filter_results,omitempty"`
|
||||
}
|
||||
|
||||
func (cc *ChatCompletionResponse) GetContent() string {
|
||||
var content string
|
||||
for _, choice := range cc.Choices {
|
||||
content += choice.Message.StringContent()
|
||||
}
|
||||
return content
|
||||
}
|
||||
|
||||
func (c ChatCompletionStreamChoice) ConvertOpenaiStream() []ChatCompletionStreamChoice {
|
||||
var function *ChatCompletionToolCallsFunction
|
||||
var functions []*ChatCompletionToolCallsFunction
|
||||
|
||||
Reference in New Issue
Block a user