fix(aiCore): update file data and mediaType extraction in convertFileBlockToFilePart function

- Modified the conversion logic to correctly extract base64 data and MIME type from the API response.
- Ensured that the filename remains unchanged during the conversion process.
This commit is contained in:
MyPrototypeWhat 2025-09-01 13:36:01 +08:00
parent e74c5a8ba3
commit 02b85afefb

View File

@ -275,8 +275,8 @@ async function convertFileBlockToFilePart(fileBlock: FileMessageBlock, model: Mo
const base64Data = await window.api.file.base64File(file.id + file.ext)
return {
type: 'file',
data: base64Data,
mediaType: 'application/pdf',
data: base64Data.data,
mediaType: base64Data.mime,
filename: file.origin_name
}
} catch (error) {