Files
firebase-ios-sdk/FirebaseAI/Sources/Types
Andrew Heard 67debaf689 feat(ai): GA prompt templates API with chat/func calling (#16676)
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.
2026-09-23 17:47:48 -04:00
..