I am not sure what setting the method
parameter to "json_mode"
(i.e. method="json_mode"
) in with_structured_output() does. It seems to make no difference to the output.
The documentation gives two options:
structured_llm = model.with_structured_output(Joke)
and
structured_llm = model.with_structured_output(Joke, method="json_mode")
But for both, the output is an object of type Joke
i.e.
Joke(setup='Why was the cat sitting on the computer?', punchline='To keep an eye on the mouse!')
and
Joke(setup='Why was the cat sitting on the computer?', punchline='Because it wanted to keep an eye on the mouse!')
respectively
Here is the link to that section in the documentation.
So what is the point of the method="json_mode"
?
I tried running the code on my mahchine and confirmed that the output is indeed the same regardless of whether the json_mode is set or not.
I am expect some sort of difference in the output result.