# `Vllm.Outputs.CompletionOutput`
[🔗](https://github.com/nshkrdotcom/vllm/blob/v0.3.0/lib/snakebridge_generated/vllm/outputs/completion_output.ex#L7)

The output data of one completion output of a request.

## Parameters

- `index` - The index of the output in the request.
- `text` - The generated output text.
- `token_ids` - The token IDs of the generated output text.
- `cumulative_logprob` - The cumulative log probability of the generated output text.
- `logprobs` - The log probabilities of the top probability words at each position if the logprobs are requested.
- `finish_reason` - The reason why the sequence is finished.
- `stop_reason` - The stop string or token id that caused the completion to stop, None if the completion finished for some other reason including encountering the EOS token.
- `lora_request` - The LoRA request that was used to generate the output.

# `t`

```elixir
@opaque t()
```

# `finish_reason`

```elixir
@spec finish_reason(SnakeBridge.Ref.t()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}
```

# `finished`

```elixir
@spec finished(
  SnakeBridge.Ref.t(),
  keyword()
) :: {:ok, boolean()} | {:error, Snakepit.Error.t()}
```

Python method `CompletionOutput.finished`.

## Returns

- `boolean()`

# `lora_request`

```elixir
@spec lora_request(SnakeBridge.Ref.t()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}
```

# `new`

```elixir
@spec new(integer(), String.t(), term(), term(), term(), [term()], keyword()) ::
  {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
```

Initialize self.  See help(type(self)) for accurate signature.

## Parameters

- `index` (integer())
- `text` (String.t())
- `token_ids` (term())
- `cumulative_logprob` (term())
- `logprobs` (term())
- `routed_experts` (term() default: None)
- `finish_reason` (term() default: None)
- `stop_reason` (term() default: None)
- `lora_request` (term() default: None)

# `routed_experts`

```elixir
@spec routed_experts(SnakeBridge.Ref.t()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}
```

# `stop_reason`

```elixir
@spec stop_reason(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
