mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 21:01:32 +08:00
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:
parent
e74c5a8ba3
commit
02b85afefb
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user