View Source OpenAI.Edits (OpenAI API Wrapper v0.1.0)
Provides the ability to interact with the OpenAI edits API.
See the OpenAI Edits API documentation here.
Link to this section Summary
Functions
Create a edit given a input(s) and parameters.
Link to this section Types
The parameters allowed for create/4
.
We make no effort to assign defaults, and so if params are left blank they will be set to whatever the OpenAI API defaults are by the server. Consult with the OpenAI documentation for more details.
The parameters are mapped 1:1 with those that OpenAI offers and so we do not explain them in detail here.
Link to this section Functions
@spec create(binary(), binary(), binary(), [create_params()]) :: {:ok, map()} | {:error, OpenAI.Error.t()}
Create a edit given a input(s) and parameters.
args
Args
model
- The OpenAI model to use to create the edit.input
- The input to create a edit for.instructions
- The instruction that tells the model how to edit the input.params
- Keyword list of params. Seecreate_params/0
.
NOTE: At the time of this writing, if you use a model that is not allowed for the edit API, OpenAI will return an invalid URL error response, like this:
OpenAI.Edits.create("text-davinci-001", "how r u?", "correct the spelling mistakes")
{:error,
%OpenAI.Error{
message: "Invalid URL (POST /v1/edits)",
code: nil,
param: nil,
type: "invalid_request_error",
raw: %{
"code" => nil,
"message" => "Invalid URL (POST /v1/edits)",
"param" => nil,
"type" => "invalid_request_error"
}
}}
This is a known issue, see here.