Hello!
Im running a n8n version(1.64.3) in docker and created an AI agent with ollama. My goal is to prepare the inputs for a calendar node. I want to return a structured output so I prompted the AI to return it as such.
“”
Your job is to determine when is the start of the event the end of the event and the title of the event.
You should return the following JSON object:
eventTitle
: Title of the eventstartDate
: Event start time (in ISO format)endDate
: Event end time (in ISO format)
For example:
{
“eventTitle”: “Test”,
“eventStart”: “2024-11-22T10:00:00+01:00”,
“eventEnd”: “2024-11-22T11:00:00+01:00”
}
It is very important that your output should be the defined JSON object and not a string!
The chat input is:
{{ $json.chatInput }}
“”
I added the structure output parser like this.
{
"type": "object",
"properties": {
"startDate": {"type": "string"},
"endDate": {"type": "string"},
"eventTitle": {"type": "string"}
}
}
In the end it cannot parse the output of the ai agent because its a text. Any idea how can i force it so it should return the required JSON object ?
Thank you very much for the help!