mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-11 10:53:42 +08:00
fix: update text handling to ensure nil checks and pointer usage for message content
This commit is contained in:
@@ -159,7 +159,9 @@ func ConvertRequest(c *gin.Context, textRequest model.GeneralOpenAIRequest) (*Re
|
||||
var content Content
|
||||
if part.Type == model.ContentTypeText {
|
||||
content.Type = "text"
|
||||
content.Text = part.Text
|
||||
if part.Text != nil {
|
||||
content.Text = *part.Text
|
||||
}
|
||||
} else if part.Type == model.ContentTypeImageURL {
|
||||
content.Type = "image"
|
||||
content.Source = &ImageSource{
|
||||
|
||||
Reference in New Issue
Block a user