This commit is contained in:
decolua
2026-06-15 18:18:04 +07:00
parent 8ab5af0052
commit b282f05549
66 changed files with 2328 additions and 213 deletions

View File

@@ -77,6 +77,14 @@ export function convertOpenAIContentToParts(content) {
inlineData: { mime_type: mimeType, data: data }
});
}
} else if (item.type === OPENAI_BLOCK.FILE && item.file?.file_data?.startsWith("data:")) {
const url = item.file.file_data;
const commaIndex = url.indexOf(",");
if (commaIndex !== -1) {
const mimeType = url.substring(5, commaIndex).split(";")[0];
const data = url.substring(commaIndex + 1);
parts.push({ inlineData: { mime_type: mimeType, data: data } });
}
}
}
}