Class: InstLLM::Response::EmbeddingResponse
- Inherits:
-
Object
- Object
- InstLLM::Response::EmbeddingResponse
- Defined in:
- lib/inst_llm/response/embedding_response.rb
Instance Attribute Summary collapse
-
#embeddings ⇒ Object
readonly
Returns the value of attribute embeddings.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(model, embeddings) ⇒ EmbeddingResponse
constructor
A new instance of EmbeddingResponse.
Constructor Details
#initialize(model, embeddings) ⇒ EmbeddingResponse
Returns a new instance of EmbeddingResponse.
8 9 10 11 |
# File 'lib/inst_llm/response/embedding_response.rb', line 8 def initialize(model, ) @model = model @embeddings = end |
Instance Attribute Details
#embeddings ⇒ Object (readonly)
Returns the value of attribute embeddings.
6 7 8 |
# File 'lib/inst_llm/response/embedding_response.rb', line 6 def @embeddings end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
6 7 8 |
# File 'lib/inst_llm/response/embedding_response.rb', line 6 def model @model end |
Class Method Details
.from_cohere_embed(model:, response:) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/inst_llm/response/embedding_response.rb', line 14 def (model:, response:) = response["embeddings"].map.with_index do |, i| { object: "embedding", embedding: , index: i } end new(model, ) end |