mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 20:00:00 +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)
|
const base64Data = await window.api.file.base64File(file.id + file.ext)
|
||||||
return {
|
return {
|
||||||
type: 'file',
|
type: 'file',
|
||||||
data: base64Data,
|
data: base64Data.data,
|
||||||
mediaType: 'application/pdf',
|
mediaType: base64Data.mime,
|
||||||
filename: file.origin_name
|
filename: file.origin_name
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user