Method: OpenAI::Resources::VectorStores::Files#content

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

#content(file_id, vector_store_id: , request_options: {}) ⇒ OpenAI::Internal::Page<OpenAI::Models::VectorStores::FileContentResponse>

Retrieve the parsed contents of a vector store file.

Parameters:

  • file_id (String)

    The ID of the file within the vector store.

  • vector_store_id (String)

    The ID of the vector store.

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

Returns:

See Also:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/openai/resources/vector_stores/files.rb', line 179

def content(file_id, params)
  parsed, options = OpenAI::VectorStores::FileContentParams.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/files/%2$s/content", vector_store_id, file_id],
    page: OpenAI::Internal::Page,
    model: OpenAI::Models::VectorStores::FileContentResponse,
    options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
  )
end