Method: OpenAI::Resources::VectorStores::Files#update

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

#update(file_id, vector_store_id: , attributes: , request_options: {}) ⇒ OpenAI::Models::VectorStores::VectorStoreFile

Some parameter documentations has been truncated, see Models::VectorStores::FileUpdateParams for more details.

Update attributes on a vector store file.

Parameters:

  • file_id (String)

    Path param: The ID of the file to update attributes.

  • vector_store_id (String)

    Path param: The ID of the vector store the file belongs to.

  • attributes (Hash{Symbol=>String, Float, Boolean}, nil)

    Body param: Set of 16 key-value pairs that can be attached to an object. This ca

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

Returns:

See Also:



85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/openai/resources/vector_stores/files.rb', line 85

def update(file_id, params)
  parsed, options = OpenAI::VectorStores::FileUpdateParams.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/files/%2$s", vector_store_id, file_id],
    body: parsed,
    model: OpenAI::VectorStores::VectorStoreFile,
    options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
  )
end