Class: OmniAI::OpenAI::Files
- Inherits:
-
Object
- Object
- OmniAI::OpenAI::Files
- Defined in:
- lib/omniai/openai/files.rb
Overview
An OpenAI scope for establishing files.
Instance Method Summary collapse
- #all ⇒ Array<OmniAI::OpenAI::File>
- #build(io: nil, purpose: File::Purpose::ASSISTANTS) ⇒ OmniAI::OpenAI::File
- #destroy!(id:) ⇒ Object
- #find(id:) ⇒ OmniAI::OpenAI::File
-
#initialize(client:) ⇒ Files
constructor
A new instance of Files.
Constructor Details
#initialize(client:) ⇒ Files
Returns a new instance of Files.
8 9 10 |
# File 'lib/omniai/openai/files.rb', line 8 def initialize(client:) @client = client end |
Instance Method Details
#all ⇒ Array<OmniAI::OpenAI::File>
24 25 26 |
# File 'lib/omniai/openai/files.rb', line 24 def all File.all(client: @client) end |
#build(io: nil, purpose: File::Purpose::ASSISTANTS) ⇒ OmniAI::OpenAI::File
39 40 41 |
# File 'lib/omniai/openai/files.rb', line 39 def build(io: nil, purpose: File::Purpose::ASSISTANTS) File.new(io:, purpose:, client: @client) end |
#destroy!(id:) ⇒ Object
31 32 33 |
# File 'lib/omniai/openai/files.rb', line 31 def destroy!(id:) File.destroy!(id:, client: @client) end |
#find(id:) ⇒ OmniAI::OpenAI::File
17 18 19 |
# File 'lib/omniai/openai/files.rb', line 17 def find(id:) File.find(id:, client: @client) end |