Ver código fonte

feat: add filename support to multi-modal prompt messages (#24777)

tags/1.8.1
-LAN- 2 meses atrás
pai
commit
20ae3eae54
Nenhuma conta vinculada ao e-mail do autor do commit

+ 1
- 0
api/core/file/file_manager.py Ver arquivo

"url": _to_url(f) if dify_config.MULTIMODAL_SEND_FORMAT == "url" else "", "url": _to_url(f) if dify_config.MULTIMODAL_SEND_FORMAT == "url" else "",
"format": f.extension.removeprefix("."), "format": f.extension.removeprefix("."),
"mime_type": f.mime_type, "mime_type": f.mime_type,
"filename": f.filename or "",
} }
if f.type == FileType.IMAGE: if f.type == FileType.IMAGE:
params["detail"] = image_detail_config or ImagePromptMessageContent.DETAIL.LOW params["detail"] = image_detail_config or ImagePromptMessageContent.DETAIL.LOW

+ 1
- 0
api/core/model_runtime/entities/message_entities.py Ver arquivo

base64_data: str = Field(default="", description="the base64 data of multi-modal file") base64_data: str = Field(default="", description="the base64 data of multi-modal file")
url: str = Field(default="", description="the url of multi-modal file") url: str = Field(default="", description="the url of multi-modal file")
mime_type: str = Field(default=..., description="the mime type of multi-modal file") mime_type: str = Field(default=..., description="the mime type of multi-modal file")
filename: str = Field(default="", description="the filename of multi-modal file")


@property @property
def data(self): def data(self):

Carregando…
Cancelar
Salvar