Class: Turbopuffer::Models::Columns
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Turbopuffer::Models::Columns
- Defined in:
- lib/turbopuffer/models/columns.rb
Defined Under Namespace
Modules: Vector
Instance Attribute Summary collapse
-
#id ⇒ Array<String, Integer>
The IDs of the documents.
-
#vector ⇒ Array<Array<Float>, String>, ...
The vector embeddings of the documents.
Instance Method Summary collapse
-
#initialize(id:, vector: nil) ⇒ Object
constructor
A list of documents in columnar format.
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(id:, vector: nil) ⇒ Object
A list of documents in columnar format. Each key is a column name, mapped to an array of values for that column.
|
|
# File 'lib/turbopuffer/models/columns.rb', line 18
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/turbopuffer/models/columns.rb', line 51 def method_missing(name, *args, &block) if @data.key?(name) @data[name] else super end end |
Instance Attribute Details
#id ⇒ Array<String, Integer>
The IDs of the documents.
10 |
# File 'lib/turbopuffer/models/columns.rb', line 10 required :id, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] } |
#vector ⇒ Array<Array<Float>, String>, ...
The vector embeddings of the documents.
16 |
# File 'lib/turbopuffer/models/columns.rb', line 16 optional :vector, union: -> { Turbopuffer::Columns::Vector } |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
59 60 61 |
# File 'lib/turbopuffer/models/columns.rb', line 59 def respond_to_missing?(name, include_private = false) @data.key?(name) || super end |