Hacker News new | ask | show | jobs
by panarky 1036 days ago
ChatGPT announced function-calling as a feature. I've found it works nine times out of ten:

https://openai.com/blog/function-calling-and-other-api-updat...

Here's a project that promises to deliver valid JSON every time:

https://news.ycombinator.com/item?id=37125118

Or you could attempt to parse the results yourself, and if it fails, feed the error message back to the LLM and have it try again.

1 comments

Ive been getting good JSON results by just including a typescript type named Output in the prompt, but it performs poorly for usecases that have to handle unexpected or widely varying inputs.

Thanks for the links, I missed OpenAi's function-calling announcement. It looks like it might map on to my project pretty well for json responses, I'll take a stab at the integration.