N8n Beta LangChain / Output parser problem

Describe the problem/error/question

I can’t use the Parser output, I have a structure that has nothing to do with it.

What is the error message (if any)?

I have no error message

Please share your workflow

Share the output returned by the last node

[

{

“properties”: {

“foo”: {

“description”: “a list of test words”,

“type”: “array”,

“items”: {

“type”: “string”

}

}

},

“required”: [

“foo”

]

}

]

Information on your n8n setup

  • n8n Beta LangChain
  • Database (default: SQLite):
  • **n8n EXECUTIONS_PROCESS main
  • **Running n8n via docker compose , custom server
  • Linux , ubuntu 22.04

Some additional information to explain my workflow. I would like to find the singer’s first and last names from their pseudonyms. It’s very difficult for some people to find them, so I used serpAPI and Wikipedia. I tried parsing on the former but it didn’t work. So I decided to create a basic LLM and put in structure name, first name, pseudo. I suppose it’s an example “json structure” that’s taken into account and not my own structure. I don’t know all the suptilities of Langchain. Any help would be appreciated.

Hi @simon_Piquemal :wave: I enlisted @oleg 's help here, but it looks like it’s an issue with your JSON. Instead of:

{
    "nom": "string",
  "prenom": "string"
}

Your root part needs to be a JSON object like this:

{
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    }
  }
}

Mind you that Oleg translated this to English, so don’t be too confused :sweat_smile: But here’s the workflow with this fixed up:

Sneaky edit: you can also probably just connect the Output parser directly, like this:

3 Likes

thank you i understand better the json structure system. Will there be a more in-depth doc and videos to explain Langchain in detail soon?

I think someone like @deborah would be the best person to ask about that, but I’d assume yes :smiley:

1 Like

I have one last question, with this system it doesn’t work 100%, especially on the json structure. Why doesn’t the Auto-fixing Output Parser automatically re-execute several times to finally get the right structure?

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