Class: Roseflow::Pinecone::Vector::Upsert
- Inherits:
-
PineconeObject
- Object
- Dry::Struct
- PineconeObject
- Roseflow::Pinecone::Vector::Upsert
- Includes:
- Roseflow::Pinecone::Vectors::Common
- Defined in:
- lib/roseflow/pinecone/vectors/upsert.rb
Defined Under Namespace
Classes: UpsertContract
Class Method Summary collapse
Methods included from Roseflow::Pinecone::Vectors::Common
Class Method Details
.from(data) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/roseflow/pinecone/vectors/upsert.rb', line 32 def self.from(data) raise ArgumentError, "Data must be a valid upsert hash" unless data.is_a?(Hash) && data.keys.include?(:vectors) new( vectors: data[:vectors].map { |vector| VectorObject.new(id: vector[:id], values: vector[:values]) }, namespace: data[:namespace] ) end |