# GenerateTypedContentRequest


```
public final class GenerateTypedContentRequest<T extends Object>
```

<br />

*** ** * ** ***

A request to generate typed content.

This is an experimental feature.

## Summary

| ### Nested types |
|---|
| `public final class https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateTypedContentRequest.Builder<T extends https://developer.android.com/reference/java/lang/Object.html>` Builder for `https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateTypedContentRequest`. |
| `public static class https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateTypedContentRequest.Companion` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateContentRequest` | `https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateTypedContentRequest#getGenerateContentRequest()()` the underlying `https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateContentRequest` that contains the input and configuration for generation. |
| `final boolean` | `https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateTypedContentRequest#getIncludeSchemaInPrompt()()` Whether to include input schema in prompt. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html T>` | `https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateTypedContentRequest#getOutputClass()()` the target class type to which the model will generate. |

## Public methods

### getGenerateContentRequest

```
public final @NonNull GenerateContentRequest getGenerateContentRequest()
```

the underlying `https://developers.google.com/android/reference/com/google/mlkit/genai/prompt/GenerateContentRequest` that contains the input and configuration for generation.

### getIncludeSchemaInPrompt

```
public final boolean getIncludeSchemaInPrompt()
```

Whether to include input schema in prompt. Default to true.

### getOutputClass

```
public final @NonNull KClass<@NonNull T> getOutputClass()
```

the target class type to which the model will generate. This class must be annotated with `@Generable`, otherwise a GenAiException with GenAiException.ErrorCode.STRUCTURED_OUTPUT_REQUEST_ERROR will be thrown during inference. Refer to Generable for more details on requirements for the annotated class.