![]() |
![]()
| ![]() |
![]()
NAMEOpenAI::API::Request::Edit - Request class for OpenAI API content editing SYNOPSISuse OpenAI::API::Request::Edit; my $request = OpenAI::API::Request::Edit->new( model => "text-davinci-edit-001", instruction => 'Correct the grammar in the following text:', input => 'the cat sat on teh mat.', ); my $res = $request->send(); # or: my $res = $request->send(%args) my $text = $res->{choices}[0]{text}; # or: my $text = "$res"; DESCRIPTIONThis module provides a request class for interacting with the OpenAI API's content editing endpoint. It inherits from OpenAI::API::Request. ATTRIBUTESmodelID of the model to use. You can use the text-davinci-edit-001 or code-davinci-edit-001 model with this endpoint. input [optional]The input text to use as a starting point for the edit. instructionThe instruction that tells the model how to edit the prompt. n [optional]How many edits to generate for the input and instruction. temperature [optional]What sampling temperature to use, between 0 and 2. top_p [optional]An alternative to sampling with temperature. INHERITED METHODSThis module inherits the following methods from OpenAI::API::Request: send(%args)send_async(%args)SEE ALSOOpenAI::API::Request, OpenAI::API::Config
|