# Candidate


```
class Candidate
```

<br />

*** ** * ** ***

A piece of a response from the model. Contains the `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate.FinishReason`, the response text, and any predicted function calls.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/annotation/IntDef.html(value = [0, 1, -100]) annotation https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate.FinishReason` The reason why this `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate` is returned. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html?` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate#finishReason()` The reason why this `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate` is finished generating. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/FunctionCall>` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate#functionCalls()` The list of function calls predicted by the model. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate#text()` The text string of the `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate`. |

## Public properties

### finishReason

```
val finishReason: Int?
```

The reason why this `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate` is finished generating. This will be null for intermediate responses during streaming, and non-null for the final response in streaming or non-streaming mode.

### functionCalls

```
val functionCalls: List<FunctionCall>
```

The list of function calls predicted by the model.

### text

```
val text: String
```

The text string of the `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/prompt/Candidate`. May be null if the model only returned function calls.