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