| 694 | } |
| 695 | |
| 696 | QVector<PluginLLMCore::ImageAttachment> ClientInterface::loadImagesFromStorage( |
| 697 | const QList<ChatModel::ImageAttachment> &storedImages) const |
| 698 | { |
| 699 | QVector<PluginLLMCore::ImageAttachment> apiImages; |
| 700 | |
| 701 | for (const auto &storedImage : storedImages) { |
| 702 | QString base64Data |
| 703 | = ChatSerializer::loadContentFromStorage(m_chatFilePath, storedImage.storedPath); |
| 704 | if (base64Data.isEmpty()) { |
| 705 | LOG_MESSAGE(QString("Warning: Failed to load image: %1").arg(storedImage.storedPath)); |
| 706 | continue; |
| 707 | } |
| 708 | |
| 709 | PluginLLMCore::ImageAttachment apiImage; |
| 710 | apiImage.data = base64Data; |
| 711 | apiImage.mediaType = storedImage.mediaType; |
| 712 | apiImage.isUrl = false; |
| 713 | |
| 714 | apiImages.append(apiImage); |
| 715 | } |
| 716 | |
| 717 | return apiImages; |
| 718 | } |
| 719 | |
| 720 | void ClientInterface::setChatFilePath(const QString &filePath) |
| 721 | { |