ggerganov / llama.cpp

LLM inference in C/C++
MIT License
60.95k stars 8.7k forks source link

`json`: update grammars/README w/ examples & note about additionalProperties #8132

Closed ochafik closed 1 day ago

ochafik commented 3 days ago

cc/ @HanClinto

HanClinto commented 2 days ago

Only other thing I think would be helpful is to give a simplistic example for generating a single object (similar to your example for generating a simple array).

Both should probably have additionalProperties set to false.

Overall this is an excellent improvement to the readme and I heartily approve!!

ochafik commented 1 day ago

Only other thing I think would be helpful is to give a simplistic example for generating a single object (similar to your example for generating a simple array).

There are simpler (but collapsed) examples in the Pydantic / Zod sections. Gonna merge this as it is now, working on some of the limitations / will retouch the doc w/ this suggestion in mind.