Comment by ngrislain
Actually, OpenAI provides Pydantic support for structured output (see client.beta.chat.completions.parse in https://platform.openai.com/docs/guides/structured-outputs).
The library is compatible with that but does not use Pydantic further than that.
Right the hope was to go further. E.g. if the input is:
```
class Classification(BaseModel):
```then the output type would be:
```
class ClassificationWithLogProbs(BaseModel):
```Don't take this too literally; I'm not convinced that this is the right way to do it. But it would provide structure and scores without dealing with a mess of complex JSON.