Error in ai agent builder

"Agent was provided a function with an unsupported input type. Remove the function or change its input type.

Details

**Error Instance ID:**352788eb-8dbd-4ee0-b39c-381a19ba909b

**Error Code:**INVALID_ARGUMENT

Error Name:

AipProfiles:FunctionInputUnsupported

Arguments:

**functionName:**extract_text_from_pdf_ita_eng

**inputType:**MediaReferenceType{}"

I am trying to build an agent that uses a tool “extract_text_from_pdf_ita_eng” to extract text from a pdf and autocomplete some blank spaces. The “extract_text_from_pdf_ita_eng” function takes in a media reference type, that seems to be unsupported. How can I extract text from a pdf in another way?

Hi @laurafranco,

Some follow up questions for additional context:

  • Does your function just extract text or does it also perform additional tasks?
  • How are you storing the pdf currently?
  • How are you planning to add the pdfs?
  • Do you need the pdfs to be processed in real time or can you also do it in a pipeline?

Just some thoughts in the meanwhile:

  • AIP agents can directly parse pdf documents if you add them to the context. They will perform either raw text extract or ocr parsing depending on the type of pdf.
  • You can upload the pdfs to objects, and retrieve the files inside the function incase you would like to utilize your function for text parsing.
  • Incase, you would like to process the documents in a pipeline, please consider using Pipeline Builder as this has lots of out of the box functionalities for dealing with unstructured data.

Please let me know on what you are seeking to achieve, so I can give you more precise advise.

Hi,
the function only extracts context, and the pdfs are not stored atm, they would be added by users of a workshop app. Eg: the user adds their cv in pdf version, the function retrieves the text, the llm fills a form on its own. So the data would need to be processed in real time. Thanks a lot

There are few potential solutions to consider here. A possible solution would involve uploading a pdf document to an object (either as mediaset or attachment property). This will then allow you to process the document via function, and also add it as a tool in your AIP Agent, incase you need the interactive functionality. Below you can find a high-level architecture for such solution:

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.