feat(dingtalk): enable secure multimodal image QA
This commit is contained in:
@@ -74,24 +74,3 @@ func readLocalStorageBytes(storagePath string) []byte {
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
// isMultimodalNotSupportedError checks if an error indicates the model does not
|
||||
// support multimodal/image input.
|
||||
func isMultimodalNotSupportedError(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
msg := strings.ToLower(err.Error())
|
||||
return (strings.Contains(msg, "multimodal") || strings.Contains(msg, "image") || strings.Contains(msg, "vision")) &&
|
||||
(strings.Contains(msg, "not support") || strings.Contains(msg, "unsupported") || strings.Contains(msg, "400"))
|
||||
}
|
||||
|
||||
// stripImagesFromMessages returns a copy of messages with all image data removed.
|
||||
func stripImagesFromMessages(messages []Message) []Message {
|
||||
cleaned := make([]Message, len(messages))
|
||||
for i, msg := range messages {
|
||||
cleaned[i] = msg
|
||||
cleaned[i].Images = nil
|
||||
}
|
||||
return cleaned
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user