Rag+Telegram but reply is a JSON

Hi all. I have create an RAG system based on n8n/Pinacle where the trigger is a “public chat”. All works but I ha ve a problema with the “output” because from the “Question and Answer chain” I (chat) receive a JSON and not only the answer.

For example this is a reply:

{ "response": "Non so." }

Information on your n8n setup

  • n8n version: 1.91.2
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu

Hi @Michel_Morelli

Use a code node after your LLM that outputs only the response. The chat will always return the last item in the flow, even if it is in json.

See this workflow as an example.

if this post helps solve your issue, please mark it as the solution so others can benefit from it

1 Like

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