Class: Chroma::Resources::Embedding

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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 = embedding
  @metadata = 
  @document = document
  @distance = distance
end

Instance Attribute Details

#distanceObject (readonly)

Returns the value of attribute distance.



12
13
14
# File 'lib/chroma/resources/embedding.rb', line 12

def distance
  @distance
end

#documentObject (readonly)

Returns the value of attribute document.



11
12
13
# File 'lib/chroma/resources/embedding.rb', line 11

def document
  @document
end

#embeddingObject (readonly)

Returns the value of attribute embedding.



9
10
11
# File 'lib/chroma/resources/embedding.rb', line 9

def embedding
  @embedding
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/chroma/resources/embedding.rb', line 8

def id
  @id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



10
11
12
# File 'lib/chroma/resources/embedding.rb', line 10

def 
  @metadata
end