Class: Langchain::LLM::ReplicateResponse
Instance Attribute Summary
Attributes inherited from BaseResponse
#context, #model, #raw_response
Instance Method Summary
collapse
#chat_completion, #chat_completions, #completion_tokens, #initialize, #prompt_tokens, #total_tokens
Instance Method Details
#completion ⇒ Object
12
13
14
|
# File 'lib/langchain/llm/response/replicate_response.rb', line 12
def completion
completions.first
end
|
#completions ⇒ Object
5
6
7
8
9
10
|
# File 'lib/langchain/llm/response/replicate_response.rb', line 5
def completions
raw_response.output[0] += " "
[raw_response.output.join]
end
|
#created_at ⇒ Object
16
17
18
|
# File 'lib/langchain/llm/response/replicate_response.rb', line 16
def created_at
Time.parse(raw_response.created_at)
end
|
#embedding ⇒ Object
20
21
22
|
# File 'lib/langchain/llm/response/replicate_response.rb', line 20
def embedding
embeddings.first
end
|
#embeddings ⇒ Object
24
25
26
|
# File 'lib/langchain/llm/response/replicate_response.rb', line 24
def embeddings
[raw_response.output]
end
|