Skip to content

RFC: first-class response objects #193

@bf4

Description

@bf4

Is your feature request related to a problem? Please describe.

Right now the gem returns raw HTTParty response objects which requires are certain amount of processing, especially on success, since the response may be successful but have an error-like response like "please retry with smaller completion length or fewer completions". Having an (opt-in) first-class response-object in the gem would solve the processing problem for all users of the gem. I'd be happy to make this contribution.

This would also make it easier to change the underlying gem from HTTParty to something else without affecting end-users.

Describe the solution you'd like

e.g. Response.from(http_response) would be an object which responds to success? but also has more information about specific response details such as choices and soft-errors like "please retry with smaller completion length or fewer completions".

Describe alternatives you've considered

Right now we do this work in our app.

Additional context

Let me know if I missed anything. I'd be happy to work on this, as an opt-in feature so that it doesn't break existing releases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions