Open hwb96 opened 1 month ago
I have the same question ^
@joerunde can you help answer this?
lm-format-enforcer seems not completely compatible with openai sdk yet,but outlines yes. So with lm-format-enforcer,I use a normal chat completions request,then parse the result in message content manually:
class Test(BaseModel):
xxxxx
completion=client.chat.completions.create(xxxx,(without response_format set),extra_body={
"guided_json":Test.schema_json ,
"guided_decoding_backend": "lm-format-enforcer"
})
raw_json = completion.choices[0].message.content
parsed = ChatRoles.parse_raw(raw_json)
Your current environment
How would you like to use vllm
The document describes structured output and additional parameters as follows:
I see there are two parameters that support JSON format output:
response_format
set to {'type': 'json_object'}, which aligns with OpenAI.guided_decoding_backend
(my personal understanding is that it is related to 'outlines
' / 'lm-format-enforcer
').My question is, which parameter has a higher priority? Or when I use:
Is
response_format
dispensable? If I useresponse_format={'type': 'json_object'}
, does it mean thatguided_json
is enabled by default?Before submitting a new issue...
I'm really confused and looking forward to your answer, thank you!