Class: Openai::Client::Files
- Inherits:
-
Object
- Object
- Openai::Client::Files
- Defined in:
- lib/openai/client/files.rb
Constant Summary collapse
- PATH =
'files'
Instance Method Summary collapse
-
#delete(id) ⇒ Hash
Public: Makes an API call to delete the file.
-
#find(id) ⇒ Hash
Public: Makes an API call to find the file by the ID.
-
#find_content(id) ⇒ Hash
Public: Makes an API call to find the contents of the specified file.
-
#list ⇒ Hash
Public: Makes an API call to return all files that belong to the user’s organization.
-
#upload(body) ⇒ Hash
Public: Makes an API call to upload a file.
Instance Method Details
#delete(id) ⇒ Hash
Public: Makes an API call to delete the file.
38 39 40 41 42 |
# File 'lib/openai/client/files.rb', line 38 def delete(id) Http.new.delete("#{PATH}/#{id}").body rescue Faraday::Error nil end |
#find(id) ⇒ Hash
Public: Makes an API call to find the file by the ID.
50 51 52 53 54 |
# File 'lib/openai/client/files.rb', line 50 def find(id) Http.new.get("#{PATH}/#{id}").body rescue Faraday::Error nil end |
#find_content(id) ⇒ Hash
Public: Makes an API call to find the contents of the specified file.
62 63 64 65 66 |
# File 'lib/openai/client/files.rb', line 62 def find_content(id) Http.new.get("#{PATH}/#{id}/content").body rescue Faraday::Error nil end |