The post asks about the success rate of getting a Large Language Model (LLM) to return JSON-formatted answers when prompted. Based on the comments, a community member shares their personal experience, which was around 80% success rate for the raw response, but 100% success rate if they stripped the text before the first { or [ and after the last } or ]. The JSON was always valid, and the only failure mode was the model adding extra text before the JSON. Another community member mentions a library called LangChain, but has not tried it and guesses it may not be better than a simple 3-line function to strip the surrounding text. The final comment expresses satisfaction with the ~100% success rate, as the community member is trying to iron out things on the TypeScript side.
I have never tried it or even looked at it closely. I blindly guesses it's no better than the 3 line function we had that stripped text surrounding the JSON.