Hi all.
Let’s say I have a text from one of the nodes like this:
[
{
"index": 0,
"message": {
"role": "assistant",
"content": "**My Wonderful Family\nI live in a house near the mountains. I have two brothers and one sister, and I was born last. My father teaches mathematics, and my mother is a nurse at a big hospital. My brothers are very smart and work hard in school. My sister is a nervous girl, but she is very kind. My grandmother also lives with us. She came from Italy when I was two years old. She has grown old, but she is still very strong. She cooks the best food!",
"logprobs": null,
"finish_reason": "stop"
}
}
]
The question is how can I separate the title from the text?
I understand that I can split the text with
{{ $json.message.content.split(" “)[0] }},
{{ $json.message.content.split(” “)[1] }},
{{ $json.message.content.split(” ")[2] }}, etc., but the challenge is to separate not specific words, but specifically the first line in the json. I need an item that I can work with further with the following text: My Wonderful Family.
Is there any way to do this? I would be very grateful for help.