结构化输出对于LLM 是一个比较重要的功能,以下是一个开源不错的工具,可以方便使用

简单说明

outlines以及instructor 是很不错的工具对于基于api 的推荐使用instructor,kor 以及langchain 集成比较好
guardrails 也算是一个不错的工具提供了结构化输出的能力,但是核心是数据的校验能力

参考资料

https://github.com/eyurtsev/korhttps://github.com/tanchongmin/strictjson

https://github.com/noamgat/lm-format-enforcer/tree/main

https://github.com/jxnl/instructor/

https://github.com/outlines-dev/outlines

https://github.com/guardrails-ai/guardrails

https://github.com/1rgs/jsonformer