zijiren233 9 mesi fa
parent
commit
93a7dc94df
4 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 2 2
      model/group.go
  2. 1 1
      model/modelconfig.go
  3. 1 1
      relay/adaptor/openai/model.go
  4. 1 1
      relay/model/message.go

+ 2 - 2
model/group.go

@@ -29,9 +29,9 @@ type Group struct {
 	Status       int              `gorm:"default:1;index"               json:"status"`
 	UsedAmount   float64          `gorm:"index"                         json:"used_amount"`
 	RPMRatio     float64          `gorm:"index"                         json:"rpm_ratio"`
-	RPM          map[string]int64 `gorm:"serializer:fastjson,type:text" json:"rpm"`
+	RPM          map[string]int64 `gorm:"serializer:fastjson;type:text" json:"rpm"`
 	TPMRatio     float64          `gorm:"index"                         json:"tpm_ratio"`
-	TPM          map[string]int64 `gorm:"serializer:fastjson,type:text" json:"tpm"`
+	TPM          map[string]int64 `gorm:"serializer:fastjson;type:text" json:"tpm"`
 	RequestCount int              `gorm:"index"                         json:"request_count"`
 }
 

+ 1 - 1
model/modelconfig.go

@@ -21,7 +21,7 @@ type ModelConfig struct {
 	CreatedAt         time.Time              `gorm:"index;autoCreateTime"          json:"created_at"`
 	UpdatedAt         time.Time              `gorm:"index;autoUpdateTime"          json:"updated_at"`
 	Config            map[ModelConfigKey]any `gorm:"serializer:fastjson;type:text" json:"config,omitempty"`
-	ImagePrices       map[string]float64     `gorm:"serializer:fastjson,type:text" json:"image_prices,omitempty"`
+	ImagePrices       map[string]float64     `gorm:"serializer:fastjson;type:text" json:"image_prices,omitempty"`
 	Model             string                 `gorm:"primaryKey"                    json:"model"`
 	Owner             ModelOwner             `gorm:"type:varchar(255);index"       json:"owner"`
 	ImageMaxBatchSize int                    `json:"image_batch_size,omitempty"`

+ 1 - 1
relay/adaptor/openai/model.go

@@ -83,7 +83,7 @@ type TextResponseChoice struct {
 	FinishReason string        `json:"finish_reason"`
 	Message      model.Message `json:"message"`
 	Index        int           `json:"index"`
-	Text         string        `json:"text"`
+	Text         string        `json:"text,omitempty"`
 }
 
 type TextResponse struct {

+ 1 - 1
relay/model/message.go

@@ -102,5 +102,5 @@ type ImageURL struct {
 type MessageContent struct {
 	ImageURL *ImageURL `json:"image_url,omitempty"`
 	Type     string    `json:"type,omitempty"`
-	Text     string    `json:"text"`
+	Text     string    `json:"text,omitempty"`
 }