Method: OpenAI::Resources::VectorStores::FileBatches#list_files

Defined in:
lib/openai/resources/vector_stores/file_batches.rb

#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.

Parameters:

  • batch_id (String)

    Path param: The ID of the file batch that the files belong to.

  • vector_store_id (String)

    Path param: The ID of the vector store that the files belong to.

  • after (String)

    Query param: A cursor for use in pagination. after is an object ID that define

  • before (String)

    Query param: A cursor for use in pagination. before is an object ID that defin

  • filter (Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter)

    Query param: Filter by file status. One of in_progress, completed, failed,

  • limit (Integer)

    Query param: A limit on the number of objects to be returned. Limit can range be

  • order (Symbol, OpenAI::Models::VectorStores::FileBatchListFilesParams::Order)

    Query param: Sort order by the created_at timestamp of the objects. asc for

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/openai/resources/vector_stores/file_batches.rb', line 119

def list_files(batch_id, params)
  parsed, options = 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"}, **options}
  )
end