Skip to content

Edits

Edit given text according to instructions

from r9s import R9S
with R9S(api_key=os.getenv("R9S_API_KEY",""),) as r9_s:
res = r9_s.edits.create(model="gpt-4o-mini", instruction="Fix the spelling mistakes", input="What day of the wek is it?", n=1, temperature=1, top_p=1)
# Handle response
print(res)
ParameterTypeRequiredDescription
modelstr:heavy_check_mark:Model name
instructionstr:heavy_check_mark:Edit instruction
inputstr:heavy_minus_sign:Input text to edit
nint:heavy_minus_sign:N/A
temperaturefloat:heavy_minus_sign:N/A
top_pfloat:heavy_minus_sign:N/A
retriesobject:heavy_minus_sign:Configuration to override the default retry behavior of the client.

EditResponse

Error TypeStatus CodeContent Type
errors.BadRequestError400application/json
errors.AuthenticationError401application/json
errors.PermissionDeniedError403application/json
errors.UnprocessableEntityError422application/json
errors.RateLimitError429application/json
errors.InternalServerError500application/json
errors.ServiceUnavailableError503application/json
errors.R9SDefaultError4XX, 5XX*/*