Skip to content

Small confusion about responseFormat vs text in CreateModelResponseQuery #392

@emirariemir

Description

@emirariemir

Hey there

I was testing out structured outputs using CreateModelResponseQuery and noticed something I wanted to double-check.

In the README it says:

“Use the derivedJsonSchema(_ type:) response format when creating a ChatQuery or CreateModelResponseQuery.”

And for ChatQuery, the example uses:

responseFormat: .jsonSchema(...)

But when I looked into the CreateModelResponseQuery source, I saw that it doesn’t have a responseFormat property instead it uses:

public let text: TextResponseConfigurationOptions?

So I tried using it and that worked just fine.

It just threw me off a bit since the JSONSchemaDefinition.derivedJsonSchema section in the README mentions responseFormat for both query types, which made me think the property names were consistent. Maybe it’s intentional (since the docs for text mention structured outputs), but I thought I’d mention it in case it’s worth clarifying in the README or unifying the naming.

If this is already intentional and I just misunderstood the docs thats totally my bad, just wanted to share what I found while experimenting in case it helps others too.

thanks so much for the awesome work on this package! i'd also be happy to open a PR for docs clarification if helpful <3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions