mirror of
https://github.com/firebase/firebase-ios-sdk
synced 2026-11-10 22:45:59 +05:45
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.