-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Hello,
According to the documentation, it should be possible to pass an expires_after parameter to automatically delete the file after a certain time.
However, when I include it in my request, I get the following error:
$openai = OpenAI::Client.new(
api_key: Rails.application.credentials.openai,
max_retries: 1
)
$openai.files.create(
file: download,
purpose: "user_data",
expires_after: {anchor: 'created_at', seconds: 3600}
)
private
def download
file = Tempfile.new([ "upload", ".pdf" ])
file.binmode
file.write(@file.download)
file.rewind
Pathname(file.path)
end
Response
{:url=>"https://api.openai.com/v1/files", :status=>400, :body=>{:error=>{:message=>"Additional properties are not allowed ('expires_after' was unexpected)", :type=>"invalid_request_error", :param=>nil, :code=>nil}}} (OpenAI::Errors::BadRequestError)
Metadata
Metadata
Assignees
Labels
No labels