Module: LLM::Anthropic::Response::Completion
- Defined in:
- lib/llm/providers/anthropic/response/completion.rb
Instance Method Summary collapse
-
#choices ⇒ Object
-
#role ⇒ Object
-
#model ⇒ Object
-
#prompt_tokens ⇒ Object
-
#completion_tokens ⇒ Object
-
#total_tokens ⇒ Object
Instance Method Details
#choices ⇒ Object
5 |
# File 'lib/llm/providers/anthropic/response/completion.rb', line 5 def choices = format_choices |
#role ⇒ Object
6 |
# File 'lib/llm/providers/anthropic/response/completion.rb', line 6 def role = body.role |
#model ⇒ Object
7 |
# File 'lib/llm/providers/anthropic/response/completion.rb', line 7 def model = body.model |
#prompt_tokens ⇒ Object
8 |
# File 'lib/llm/providers/anthropic/response/completion.rb', line 8 def prompt_tokens = body.usage&.input_tokens || 0 |
#completion_tokens ⇒ Object
9 |
# File 'lib/llm/providers/anthropic/response/completion.rb', line 9 def completion_tokens = body.usage&.output_tokens || 0 |
#total_tokens ⇒ Object
10 |
# File 'lib/llm/providers/anthropic/response/completion.rb', line 10 def total_tokens = prompt_tokens + completion_tokens |