Procházet zdrojové kódy

feat: support document type

Yeuoly před 8 měsíci
rodič
revize
57ca9adace
1 změnil soubory, kde provedl 9 přidání a 5 odebrání
  1. 9 5
      internal/types/entities/model_entities/llm.go

+ 9 - 5
internal/types/entities/model_entities/llm.go

@@ -77,23 +77,27 @@ func isPromptMessageContent(fl validator.FieldLevel) bool {
 type PromptMessageContentType string
 
 const (
-	PROMPT_MESSAGE_CONTENT_TYPE_TEXT  PromptMessageContentType = "text"
-	PROMPT_MESSAGE_CONTENT_TYPE_IMAGE PromptMessageContentType = "image"
+	PROMPT_MESSAGE_CONTENT_TYPE_TEXT     PromptMessageContentType = "text"
+	PROMPT_MESSAGE_CONTENT_TYPE_IMAGE    PromptMessageContentType = "image"
+	PROMPT_MESSAGE_CONTENT_TYPE_DOCUMENT PromptMessageContentType = "document"
 )
 
 func isPromptMessageContentType(fl validator.FieldLevel) bool {
 	value := fl.Field().String()
 	switch value {
 	case string(PROMPT_MESSAGE_CONTENT_TYPE_TEXT),
-		string(PROMPT_MESSAGE_CONTENT_TYPE_IMAGE):
+		string(PROMPT_MESSAGE_CONTENT_TYPE_IMAGE),
+		string(PROMPT_MESSAGE_CONTENT_TYPE_DOCUMENT):
 		return true
 	}
 	return false
 }
 
 type PromptMessageContent struct {
-	Type PromptMessageContentType `json:"type" validate:"required,prompt_message_content_type"`
-	Data string                   `json:"data" validate:"required"`
+	Type         PromptMessageContentType `json:"type" validate:"required,prompt_message_content_type"`
+	Data         string                   `json:"data" validate:"required"`
+	EncodeFormat string                   `json:"encode_format"`
+	MimeType     string                   `json:"mime_type"`
 }
 
 type PromptMessageToolCall struct {