Add grammar
to chat/completions endpoint / Messages API
#1858
Labels
grammar
to chat/completions endpoint / Messages API
#1858
Feature request
Add grammar as additional parameter to chat/completions.
Motivation
Constrained decoding with grammars is a killer feature for many users. Exposing
grammar
parameter would allows users to guide chat completions output with regex or json schemes.The openai client has an extra_body argument, so that we could access TGI endpoints as follows
This exposes grammars in all frameworks based on openai client. E.g., grammars could also be used via
bind(extrabody=...)
in LangChain OpenAIChatModels hooked on TGI Messages API.Your contribution
Discuss implementations, test, documentation
The text was updated successfully, but these errors were encountered: