Submit a single text input and instructions to the Edits endpoint, using the code-davinci-edit-001
model to generate code or refactor, and return only the message generated.
Text input to submit, generally used only if you are instruction the model to refactor existing code.
Instructions to model
Optional
options: objectSubmit a single text input and instructions to the Edits endpoint, using the text-davinci-edit-001
model, and return only the message generated. Convenience method for single request input.
Text input to submit
Instructions to model
Optional
options: objectExecute a request against the OpenAI API. For successful requests, the HTTPResponse object will contain an object or array or objects decoded from the JSON returned by OpenAI as appropriate to the request made. Refer to OpenAI API documentation for details about the expected parameters and responses.
Optional
data?: { An object containing data to be encoded into the HTTP body of the request. Drafts will take care of the JSON conversion.
Optional
headers?: { An object contain key-values to be added as custom headers in the request. There is no need to provide authorization headers, Drafts will add those.
The HTTP method, like "GET", "POST", etc.
Optional
parameters?: { An object containing key-values to be added to the request as URL parameters. Drafts will take care of encoding these.
The path to the API endpoint in the OpenAI API. This should include the path after the API version. For example /chat/completion
Static
createCreates a new OpenAI object.
Optional
apiKey: stringA valid OpenAI API Key. This value is optional, and if not provided, the default OpenAPI API key stored in Credentials will be used, or the user prompted to provide an API Key to store. Only provide a specific API Key if you desire to override the default.
Generated using TypeDoc
Script integration with OpenAI API. This object offers convenience over direct HTTP requests by:
Example
Translation
Direct API Request