Class: OpenAI::VectorStoreFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/vector_store_files.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VectorStoreFiles

Returns a new instance of VectorStoreFiles.



3
4
5
# File 'lib/openai/vector_store_files.rb', line 3

def initialize(client:)
  @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION)
end

Instance Method Details

#create(vector_store_id:, parameters: {}) ⇒ Object



15
16
17
# File 'lib/openai/vector_store_files.rb', line 15

def create(vector_store_id:, parameters: {})
  @client.json_post(path: "/vector_stores/#{vector_store_id}/files", parameters: parameters)
end

#delete(vector_store_id:, id:) ⇒ Object



19
20
21
# File 'lib/openai/vector_store_files.rb', line 19

def delete(vector_store_id:, id:)
  @client.delete(path: "/vector_stores/#{vector_store_id}/files/#{id}")
end

#list(vector_store_id:, parameters: {}) ⇒ Object



7
8
9
# File 'lib/openai/vector_store_files.rb', line 7

def list(vector_store_id:, parameters: {})
  @client.get(path: "/vector_stores/#{vector_store_id}/files", parameters: parameters)
end

#retrieve(vector_store_id:, id:) ⇒ Object



11
12
13
# File 'lib/openai/vector_store_files.rb', line 11

def retrieve(vector_store_id:, id:)
  @client.get(path: "/vector_stores/#{vector_store_id}/files/#{id}")
end