How do structured outputs via functions or response_format actually get processed in the prompt?

Have seen variations of this question asked but don’t believe I’ve seen a direct answer. I’m curious when an output schema is passed in using either the functions parameter or response_format parameter, does anyone know how that gets passed in during inference? I.e., does the model process system + user prompt and then a string of the output schema with some under the hood instructions on adhering to it? Is there some deep internal serialization of the schema?

Any help would be appreciated :slight_smile:

1 Like