Class: Chroma::Resources::Embedding
- Inherits:
-
Object
- Object
- Chroma::Resources::Embedding
- Defined in:
- lib/chroma/resources/embedding.rb
Overview
A Embedding class represents an embedding by its Id, metadata, and document. This class is used by Collection class.
Instance Attribute Summary collapse
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#embedding ⇒ Object
readonly
Returns the value of attribute embedding.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(id:, embedding: nil, metadata: nil, document: nil, distance: nil) ⇒ Embedding
constructor
A new instance of Embedding.
Constructor Details
#initialize(id:, embedding: nil, metadata: nil, document: nil, distance: nil) ⇒ Embedding
Returns a new instance of Embedding.
14 15 16 17 18 19 20 |
# File 'lib/chroma/resources/embedding.rb', line 14 def initialize(id:, embedding: nil, metadata: nil, document: nil, distance: nil) @id = id @embedding = @metadata = @document = document @distance = distance end |
Instance Attribute Details
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
12 13 14 |
# File 'lib/chroma/resources/embedding.rb', line 12 def distance @distance end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
11 12 13 |
# File 'lib/chroma/resources/embedding.rb', line 11 def document @document end |
#embedding ⇒ Object (readonly)
Returns the value of attribute embedding.
9 10 11 |
# File 'lib/chroma/resources/embedding.rb', line 9 def @embedding end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/chroma/resources/embedding.rb', line 8 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
10 11 12 |
# File 'lib/chroma/resources/embedding.rb', line 10 def @metadata end |