Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/model/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Message struct {
ElapsedTime int64 `json:"elapsed_time" gorm:"default:0"`
IsStream bool `json:"is_stream" gorm:"default:false"`
QuotaContent string `json:"quota_content" gorm:"default:''"`
AgentCustomConfig string `json:"agent_custom_config" gorm:"default:''"`
AgentCustomConfig string `json:"agent_custom_config" gorm:"default:'';type:text"`
BaseModel
}

Expand Down
9 changes: 8 additions & 1 deletion web/front/src/renderer/main/views/chat/completion/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,14 @@ const imageFile = ref()
const validator = (item) => {
return (rule, value, callback) => {
if (item.required) {
const hasVal = item.value.some((item) => item.trim())
let hasVal = false
if (['file', 'array_image', 'array_audio', 'array_video', 'array_file'].includes(item.type)) {
hasVal = Array.isArray(item.value) && item.value.length > 0
} else if (Array.isArray(item.value)) {
hasVal = item.value.some((val) => val && String(val).trim().length > 0)
} else {
hasVal = item.value && String(item.value).trim().length > 0
}
if (hasVal) callback()
else callback(new Error(`请添加${item.label}`))
} else {
Expand Down