docs(ai): mark prompt templates as public preview (#16741)

Revert the General Availability (GA) designation for Server Prompt
Templates in docstrings and CHANGELOG.md. Multi-turn conversations
(`TemplateChat`) and function calling (`TemplateTool`) remain public,
annotated with Public Preview warnings.

Key changes:
- Add Public Preview annotations and warnings across the Server Prompt
  Templates public API surface (TemplateGenerativeModel, TemplateChat,
  TemplateTool, and TemplateToolConfig).
- Update CHANGELOG.md to reflect Public Preview status.
This commit is contained in:
Andrew Heard
2026-09-30 12:15:54 -04:00
committed by GitHub
parent e0cc456ea9
commit 5dd4053791
6 changed files with 54 additions and 20 deletions
+4 -4
View File
@@ -23,11 +23,11 @@
`FirebaseAI`, which has now been removed. See the
[Swift module name change](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting#swift-module-name-change)
FAQ entry for more details.
- [feature] Server Prompt Templates is now Generally Available (GA). This
release also adds support for multi-turn conversations (`TemplateChat`) and
function calling (`TemplateTool`). See the
- [feature] **Public Preview**: Added support for multi-turn conversations
(`TemplateChat`) and function calling (`TemplateTool`) with Server Prompt
Templates. See the
[getting started guide](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started)
for more details. (#16676)
for more details. (#16740)
- [changed] Updated the default function calling mode to `VALIDATED` and
updated guided generation to use `responseJsonSchema` in
`GeminiLanguageModel`. (#16649)
+3 -1
View File
@@ -108,7 +108,9 @@ public final class FirebaseAI: Sendable {
)
}
/// Initializes a new `TemplateGenerativeModel`.
/// **[Public Preview]** Initializes a new `TemplateGenerativeModel`.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// Server prompt templates let you store prompts, schemas, tools, and configurations on the
/// server, decoupling prompt iteration from app release cycles.
+15 -5
View File
@@ -14,7 +14,9 @@
import Foundation
/// An ongoing conversation with a model backed by a server prompt template.
/// **[Public Preview]** An ongoing conversation with a model backed by a server prompt template.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// A `TemplateChat` manages conversation history on the client while utilizing the prompt,
/// system instructions, and configurations defined in a server prompt template. The template's
@@ -63,7 +65,9 @@ public final class TemplateChat: Sendable {
}
}
/// Sends a message to the model and returns the response.
/// **[Public Preview]** Sends a message to the model and returns the response.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// - Parameter content: The message content to send to the model, including any
/// ``FunctionResponsePart``s responding to previous function calls; pass an empty array to
@@ -86,7 +90,9 @@ public final class TemplateChat: Sendable {
return response
}
/// Sends a message to the model and returns the response.
/// **[Public Preview]** Sends a message to the model and returns the response.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// Calling this method with no arguments sends an empty turn, which runs the template's own
/// prompt against the current history without adding any new content. This is typically how the
@@ -111,9 +117,11 @@ public final class TemplateChat: Sendable {
return try await sendMessage([ModelContent(parts: parts)])
}
/// Sends a message to the model and returns the response as a stream of
/// **[Public Preview]** Sends a message to the model and returns the response as a stream of
/// `GenerateContentResponse`s.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// - Parameter content: The message to send to the model, including any ``FunctionResponsePart``s
/// responding to previous function calls; pass an empty array to send an empty turn.
/// - Returns: An `AsyncThrowingStream` that yields `GenerateContentResponse` objects.
@@ -162,9 +170,11 @@ public final class TemplateChat: Sendable {
}
}
/// Sends a message to the model and returns the response as a stream of
/// **[Public Preview]** Sends a message to the model and returns the response as a stream of
/// `GenerateContentResponse`s.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// Calling this method with no arguments sends an empty turn, which runs the template's own
/// prompt against the current history without adding any new content.
///
@@ -14,7 +14,10 @@
import Foundation
/// A multimodal model (like Gemini) that generates content using server-managed prompt templates.
/// **[Public Preview]** A multimodal model (like Gemini) that generates content using
/// server-managed prompt templates.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// When using server prompt templates, prompts, system instructions, tools, and model
/// configurations are defined and stored server-side in the Firebase console or via the Firebase AI
@@ -58,7 +61,9 @@ public final class TemplateGenerativeModel: Sendable {
self.requestOptions = requestOptions
}
/// Generates content from a prompt template and inputs.
/// **[Public Preview]** Generates content from a prompt template and inputs.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// - Parameters:
/// - templateID: The ID of the server prompt template to use (for example,
@@ -80,7 +85,10 @@ public final class TemplateGenerativeModel: Sendable {
)
}
/// Generates content from a prompt template and inputs, with streaming responses.
/// **[Public Preview]** Generates content from a prompt template and inputs, with streaming
/// responses.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// - Parameters:
/// - templateID: The ID of the server prompt template to use (for example,
@@ -102,8 +110,10 @@ public final class TemplateGenerativeModel: Sendable {
)
}
/// Creates a new chat conversation using this model with the provided template, inputs, and
/// history.
/// **[Public Preview]** Creates a new chat conversation using this model with the provided
/// template, inputs, and history.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// The template's model, system instructions, and configurations apply to every turn
/// automatically, while the returned ``TemplateChat`` tracks conversation history.
@@ -12,7 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
/// A tool that a model may use when generating responses with server prompt templates.
/// **[Public Preview]** A tool that a model may use when generating responses with server prompt
/// templates.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// In Server Prompt Templates, tools available to the model must be listed in the `tools` object of
/// the template's frontmatter. Server-side tools like Grounding with Google Search
@@ -50,7 +53,10 @@ public struct TemplateTool: Sendable {
}
public extension TemplateTool {
/// Creates a tool that allows the model to perform function calling in server prompt templates.
/// **[Public Preview]** Creates a tool that allows the model to perform function calling in
/// server prompt templates.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// In Server Prompt Templates, functions available to the model must be listed in the `tools`
/// object of the template's frontmatter. Defining schemas in client code via this method allows
@@ -77,7 +83,9 @@ public extension TemplateTool {
return self.init(functionDeclarations: functionDeclarations)
}
/// Creates a tool that allows the model to use Grounding with Google Maps.
/// **[Public Preview]** Creates a tool that allows the model to use Grounding with Google Maps.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// Grounding with Google Maps connects the model to Google Maps to access geospatial data and
/// incorporate location-aware information into responses. To use this tool, `googleMaps` must
@@ -14,7 +14,9 @@
import Foundation
/// Tool configuration options for tools used with server prompt templates.
/// **[Public Preview]** Tool configuration options for tools used with server prompt templates.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// In Server Prompt Templates, `TemplateToolConfig` allows the client application to supply
/// runtime configuration parameters for tools declared in the template's frontmatter.
@@ -25,7 +27,9 @@ public struct TemplateToolConfig: Sendable, Encodable {
/// Configures how the model should use retrieval options for Grounding with Google Maps.
public let retrievalConfig: RetrievalConfig?
/// Constructs a new `TemplateToolConfig`.
/// **[Public Preview]** Constructs a new `TemplateToolConfig`.
///
/// > Warning: This API is a public preview and may be subject to change.
///
/// - Parameter retrievalConfig: Configures retrieval options (such as user location coordinates
/// and language preferences) for Grounding with Google Maps.