# TemplateGenerativeModelFutures


```
abstract class TemplateGenerativeModelFutures
```

<br />

*** ** * ** ***

Wrapper class providing Java compatible methods for `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/TemplateGenerativeModel`.

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/TemplateGenerativeModel` |   |

## Summary

| ### Public companion functions |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/java/TemplateGenerativeModelFutures` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/java/TemplateGenerativeModelFutures#from(com.google.firebase.ai.TemplateGenerativeModel)(model: https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/TemplateGenerativeModel)` |

| ### Public functions |
|---|---|
| `abstract https://firebase.google.com/docs/reference/kotlin/com/google/common/util/concurrent/ListenableFuture<https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/GenerateContentResponse>` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/java/TemplateGenerativeModelFutures#generateContent(kotlin.String,kotlin.collections.Map)(templateId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, inputs: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html>)` Generates new content using the given templateId with the given inputs. |
| `abstract https://firebase.google.com/docs/reference/kotlin/org/reactivestreams/Publisher<https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/GenerateContentResponse>` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/java/TemplateGenerativeModelFutures#generateContentStream(kotlin.String,kotlin.collections.Map)(templateId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, inputs: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html>)` Generates new content as a stream using the given templateId with the given inputs. |
| `abstract https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/TemplateGenerativeModel` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/java/TemplateGenerativeModelFutures#getGenerativeModel()()` Returns the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/TemplateGenerativeModel` object wrapped by this object. |

## Public companion functions

### from

```
fun from(model: TemplateGenerativeModel): TemplateGenerativeModelFutures
```

| Returns |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/java/TemplateGenerativeModelFutures` | a `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/java/TemplateGenerativeModelFutures` created around the provided `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/TemplateGenerativeModel` |

## Public functions

### generateContent

```
abstract fun generateContent(templateId: String, inputs: Map<String, Any>): ListenableFuture<GenerateContentResponse>
```

Generates new content using the given templateId with the given inputs.

| Parameters |
|---|---|
| `templateId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The ID of server prompt template. |
| `inputs: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html>` | the inputs needed to fill in the prompt |

| Returns |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/common/util/concurrent/ListenableFuture<https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/GenerateContentResponse>` | The content generated by the model. |

| Throws |
|---|---|
| `com.google.firebase.ai.type.FirebaseAIException: https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/FirebaseAIException` | if the request failed. |

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/FirebaseAIException` | for types of errors. |

### generateContentStream

```
abstract fun generateContentStream(templateId: String, inputs: Map<String, Any>): Publisher<GenerateContentResponse>
```

Generates new content as a stream using the given templateId with the given inputs.

| Parameters |
|---|---|
| `templateId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The ID of server prompt template. |
| `inputs: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html>` | the inputs needed to fill in the prompt |

| Returns |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/org/reactivestreams/Publisher<https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/GenerateContentResponse>` | A `https://firebase.google.com/docs/reference/kotlin/org/reactivestreams/Publisher` which will emit responses as they are returned by the model. |

| Throws |
|---|---|
| `com.google.firebase.ai.type.FirebaseAIException: https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/FirebaseAIException` | if the request failed. |

| See also |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/type/FirebaseAIException` | for types of errors. |

### getGenerativeModel

```
abstract fun getGenerativeModel(): TemplateGenerativeModel
```

Returns the `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/TemplateGenerativeModel` object wrapped by this object.