Unable to Convert Bundle into JSON elements

Hi all,
I am working on a scenario where sentiment analysis of feedback is being done and a auto response is being generated.
I am using Google Gemini AI (Completion unit) module which receives feedback in the form of text as input and it performs following actions.

  1. Sentiment analysis: positive or Negative
  2. Categorization
  3. Response email
    The output bundle from Gemini AI is:
  • Result
"Category": ["Environment"], 
"Response": "Hello, Thank you for your feedback. } ```

I have tried many modules (Json Parser, aggregator to capture each element into a spreadsheet (sentiment, category and Response) but everytime it is throwing error of " DataError
Source is not valid JSON." ###### Origin

What can I do that the individual elements of json output bundle from Gemini AI be captured in the next module without hitting the error.

Thanks!

Adding screenshots for reference:


Hi @vikasraina
You should only parse this part of the text. You can remove the irrelevant text with the help of the replace function.

2 Likes

@ ponvaskon Thank you so much. It worked
For the benefit of larger audience, here is what I did:

  1. Added a Text Parser module (Advanced) once the response is generated by AI
  2. parse the response to select text between { & }
  3. pass it as Input parameter to JSON format
    Screenshot below for reference.
    Worked like a Charm.

2 Likes