Class: Langchain::LLM::CohereResponse
Instance Attribute Summary
Attributes inherited from BaseResponse
#context, #model, #raw_response
Instance Method Summary
collapse
#chat_completion, #chat_completions, #completion_tokens, #created_at, #initialize, #prompt_tokens, #total_tokens
Instance Method Details
#completion ⇒ Object
17
18
19
|
# File 'lib/langchain/llm/response/cohere_response.rb', line 17
def completion
completions&.dig(0, "text")
end
|
#completions ⇒ Object
13
14
15
|
# File 'lib/langchain/llm/response/cohere_response.rb', line 13
def completions
raw_response.dig("generations")
end
|
#embedding ⇒ Object
5
6
7
|
# File 'lib/langchain/llm/response/cohere_response.rb', line 5
def embedding
embeddings.first
end
|
#embeddings ⇒ Object
9
10
11
|
# File 'lib/langchain/llm/response/cohere_response.rb', line 9
def embeddings
raw_response.dig("embeddings")
end
|