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.
Nest `Tool` inside `GenerativeModel` as `GenerativeModel.Tool` to avoid
naming conflicts with Apple's `FoundationModels.Tool` protocol when both
modules are imported in the same file.
Moving `Tool` into `GenerativeModel` allows developers to adopt Apple's
Foundation Models framework without ambiguous symbol errors for
unqualified `Tool`. Call sites passing tools via leading-dot syntax
(e.g., `tools: [.googleSearch()]`) continue to work without changes.
- Nest `Tool` inside `GenerativeModel` and remove top-level `Tool`.
- Move static conveniences (`.googleSearch()`, `.googleMaps()`,
`.functionDeclarations()`, `.urlContext()`, `.codeExecution()`) to an
extension on `GenerativeModel.Tool`.
- Update `FirebaseAI.generativeModel`, `FirebaseAI.liveModel`,
`LiveGenerativeModel`, and internal request types to use
`GenerativeModel.Tool`.
- Remove leftover internal `isFoundationModeCompatible` property.
- Update DocC links and unit/integration tests across the module.
BREAKING CHANGE: The top-level `Tool` type in `FirebaseAILogic` has been
removed and nested inside `GenerativeModel` as `GenerativeModel.Tool`.
Call sites explicitly typed as `Tool` must update to
`GenerativeModel.Tool`. Calls using leading-dot syntax continue to
compile unmodified.
Promote Server Prompt Templates to General Availability (GA) in the
FirebaseAILogic Swift SDK, enabling developers to decouple prompt
engineering, schemas, and model configs from client release cycles.
Key changes:
- Expose TemplateGenerativeModel publicly via FirebaseAI's
templateGenerativeModel(tools:toolConfig:requestOptions:).
- Introduce TemplateChat and TemplateGenerativeModel.startChat for
multi-turn conversations with templates containing {{history}},
supporting empty turns to run template prompts.
- Add TemplateTool with functionDeclarations and googleMaps, as well
as TemplateToolConfig for Grounding with Google Maps.
- Add Schema.toJSONSchema() to convert Schema instances to JSON Schema
Draft 7/2020-12 for function parameter declarations.
- Add TemplateInput conversion supporting primitives, arrays, and
dictionaries, with NSNumber boolean disambiguation and rich errors.
- Sanitize and percent-encode template IDs in request URLs to prevent
path and method injection.
- Add comprehensive unit test coverage and end-to-end integration
tests covering generation, streaming, chat, and function calling.