Skip to content

Commit ef90dce

Browse files
author
David Motsonashvili
committed
remove history param from TemplateGenerativeModel
1 parent e63f756 commit ef90dce

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

firebase-ai/api.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ package com.google.firebase.ai {
8888
}
8989

9090
@com.google.firebase.ai.type.PublicPreviewAPI public final class TemplateGenerativeModel {
91-
method public suspend Object? generateContent(String templateId, java.util.Map<java.lang.String,?> inputs, java.util.List<com.google.firebase.ai.type.Content>? history = null, kotlin.coroutines.Continuation<? super com.google.firebase.ai.type.GenerateContentResponse>);
92-
method public kotlinx.coroutines.flow.Flow<com.google.firebase.ai.type.GenerateContentResponse> generateContentStream(String templateId, java.util.Map<java.lang.String,?> inputs, java.util.List<com.google.firebase.ai.type.Content>? history = null);
91+
method public suspend Object? generateContent(String templateId, java.util.Map<java.lang.String,?> inputs, kotlin.coroutines.Continuation<? super com.google.firebase.ai.type.GenerateContentResponse>);
92+
method public kotlinx.coroutines.flow.Flow<com.google.firebase.ai.type.GenerateContentResponse> generateContentStream(String templateId, java.util.Map<java.lang.String,?> inputs);
9393
}
9494

9595
@com.google.firebase.ai.type.PublicPreviewAPI public final class TemplateImagenModel {

firebase-ai/src/main/kotlin/com/google/firebase/ai/TemplateGenerativeModel.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,17 @@ internal constructor(
7979
*
8080
* @param templateId The ID of the prompt template to use.
8181
* @param inputs A map of variables to substitute into the template.
82-
* @param history history to be passed to the model (for multi-turn generation)
8382
* @return The content generated by the model.
8483
* @throws [FirebaseAIException] if the request failed.
8584
* @see [FirebaseAIException] for types of errors.
8685
*/
8786
public suspend fun generateContent(
8887
templateId: String,
8988
inputs: Map<String, Any>,
90-
history: List<Content>? = null
9189
): GenerateContentResponse =
9290
try {
9391
controller
94-
.templateGenerateContent("$templateUri$templateId", constructRequest(inputs, history))
92+
.templateGenerateContent("$templateUri$templateId", constructRequest(inputs))
9593
.toPublic()
9694
.validate()
9795
} catch (e: Throwable) {
@@ -103,18 +101,16 @@ internal constructor(
103101
*
104102
* @param templateId The ID of the prompt template to use.
105103
* @param inputs A map of variables to substitute into the template.
106-
* @param history history to be passed to the model (for multi-turn generation)
107104
* @return A [Flow] which will emit responses as they are returned by the model.
108105
* @throws [FirebaseAIException] if the request failed.
109106
* @see [FirebaseAIException] for types of errors.
110107
*/
111108
public fun generateContentStream(
112109
templateId: String,
113-
inputs: Map<String, Any>,
114-
history: List<Content>? = null
110+
inputs: Map<String, Any>
115111
): Flow<GenerateContentResponse> =
116112
controller
117-
.templateGenerateContentStream("$templateUri$templateId", constructRequest(inputs, history))
113+
.templateGenerateContentStream("$templateUri$templateId", constructRequest(inputs))
118114
.catch { throw FirebaseAIException.from(it) }
119115
.map { it.toPublic().validate() }
120116

0 commit comments

Comments
 (0)