Skip to content

Use fallback options to guarantee a successful output #952

@moritz-gross

Description

@moritz-gross

When I first looked into this project, I thought you could get a guarantee (not just reasonable high chance) that you will get a response in the required schema.
From my experience, this isn't the case, unless I used the library incorrectly.

I think this could be implemented by using a fallback in the stream, i.e. when you receive a token that is incompatible with the schema, you instead go on with the 2nd most likely option, etc.

How feasible is this idea? For GPT-4, you have access to the logprobs, which would enable this approach, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions