MuleSoft-AI-Chain-Project / example-mule-apps

This repository includes different mule apps example for MuleChain
MIT License
3 stars 2 forks source link

PDF causes error #9

Closed matt-burke-mulesoft closed 20 minutes ago

matt-burke-mulesoft commented 4 days ago

Hi! Love the project, and thanks for making it. I am getting a bug on trying to ingest a PDF. Error is:

org.mule.runtime.core.internal.message.ErrorBuilder$DeserializableErrorImplementation { description=Unsupported File Type: PDF detailedDescription=Unsupported File Type: PDF errorType=MS-AICHAIN:EMBEDDING_OPERATIONS_FAILURE cause=java.lang.IllegalArgumentException errorMessage=- suppressedErrors=[] childErrors=[] }

FWIW, I tried a text file (TXT) which worked fine. I tried 2 different PDFs, same error. Smallest PDF was 1 MB, largest was 22 MB. NOTE: I am using Mule AI Chain v 0.3.0, which I pulled today around 11am East Coast time

amirkhan-ak-sf commented 2 hours ago

@matt-burke-mulesoft please use ANY instead of PDF to import PDF or any other file type i.e. MS Office.

matt-burke-mulesoft commented 20 minutes ago

Thank you, you were correct. Changing the dropdown in the processor from the variable payload.fileType to the constant 'any' worked. As another idea, I added a TRANSFORM processor just before, and it works too...

%dw 2.0 import * from dw::util::Values output application/json

(if (lower(payload.fileType as String) contains "pdf") (payload update "fileType" with "any") else payload)