Class: OpenAI::Resources::VectorStores::FileBatches
- Inherits:
-
Object
- Object
- OpenAI::Resources::VectorStores::FileBatches
- Defined in:
- lib/openai/resources/vector_stores/file_batches.rb
Instance Method Summary collapse
-
#cancel(batch_id, vector_store_id:, request_options: {}) ⇒ OpenAI::Models::VectorStores::VectorStoreFileBatch
Cancel a vector store file batch.
-
#create(vector_store_id, attributes: nil, chunking_strategy: nil, file_ids: nil, files: nil, request_options: {}) ⇒ OpenAI::Models::VectorStores::VectorStoreFileBatch
Some parameter documentations has been truncated, see Models::VectorStores::FileBatchCreateParams for more details.
-
#initialize(client:) ⇒ FileBatches
constructor
private
A new instance of FileBatches.
-
#list_files(batch_id, vector_store_id:, after: nil, before: nil, filter: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::CursorPage<OpenAI::Models::VectorStores::VectorStoreFile>
Some parameter documentations has been truncated, see Models::VectorStores::FileBatchListFilesParams for more details.
-
#retrieve(batch_id, vector_store_id:, request_options: {}) ⇒ OpenAI::Models::VectorStores::VectorStoreFileBatch
Retrieves a vector store file batch.
Constructor Details
#initialize(client:) ⇒ FileBatches
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FileBatches.
140 141 142 |
# File 'lib/openai/resources/vector_stores/file_batches.rb', line 140 def initialize(client:) @client = client end |
Instance Method Details
#cancel(batch_id, vector_store_id:, request_options: {}) ⇒ OpenAI::Models::VectorStores::VectorStoreFileBatch
Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.
81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/openai/resources/vector_stores/file_batches.rb', line 81 def cancel(batch_id, params) parsed, = OpenAI::VectorStores::FileBatchCancelParams.dump_request(params) vector_store_id = parsed.delete(:vector_store_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["vector_stores/%1$s/file_batches/%2$s/cancel", vector_store_id, batch_id], model: OpenAI::VectorStores::VectorStoreFileBatch, options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **} ) end |
#create(vector_store_id, attributes: nil, chunking_strategy: nil, file_ids: nil, files: nil, request_options: {}) ⇒ OpenAI::Models::VectorStores::VectorStoreFileBatch
Some parameter documentations has been truncated, see Models::VectorStores::FileBatchCreateParams for more details.
Create a vector store file batch.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/openai/resources/vector_stores/file_batches.rb', line 29 def create(vector_store_id, params = {}) parsed, = OpenAI::VectorStores::FileBatchCreateParams.dump_request(params) @client.request( method: :post, path: ["vector_stores/%1$s/file_batches", vector_store_id], body: parsed, model: OpenAI::VectorStores::VectorStoreFileBatch, options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **} ) end |
#list_files(batch_id, vector_store_id:, after: nil, before: nil, filter: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::CursorPage<OpenAI::Models::VectorStores::VectorStoreFile>
Some parameter documentations has been truncated, see Models::VectorStores::FileBatchListFilesParams for more details.
Returns a list of vector store files in a batch.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/openai/resources/vector_stores/file_batches.rb', line 121 def list_files(batch_id, params) parsed, = OpenAI::VectorStores::FileBatchListFilesParams.dump_request(params) vector_store_id = parsed.delete(:vector_store_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["vector_stores/%1$s/file_batches/%2$s/files", vector_store_id, batch_id], query: parsed, page: OpenAI::Internal::CursorPage, model: OpenAI::VectorStores::VectorStoreFile, options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **} ) end |
#retrieve(batch_id, vector_store_id:, request_options: {}) ⇒ OpenAI::Models::VectorStores::VectorStoreFileBatch
Retrieves a vector store file batch.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/openai/resources/vector_stores/file_batches.rb', line 53 def retrieve(batch_id, params) parsed, = OpenAI::VectorStores::FileBatchRetrieveParams.dump_request(params) vector_store_id = parsed.delete(:vector_store_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["vector_stores/%1$s/file_batches/%2$s", vector_store_id, batch_id], model: OpenAI::VectorStores::VectorStoreFileBatch, options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **} ) end |