Files
firebase-ios-sdk/GeminiLanguageModel/Tests
Andrew Heard 7828d410ba feat(ai): add GeminiLanguageModel tool calling (#16620)
Add function calling (tool calling) support to GeminiLanguageModel
conforming to Apple's FoundationModels framework.

* Add .toolCalling capability to GeminiLanguageModel.
* Translate FoundationModels ToolDefinition into Gemini Tool and
  FunctionDeclaration using OpenAPI parametersJsonSchema.
* Map GenerationOptions.ToolCallingMode (.allowed, .required,
  .disallowed) to Gemini FunctionCallingConfig.Mode.
* Stream function calls in GeminiLanguageModelExecutor, forwarding
  JSON-encoded arguments or empty fallback "{}" into channel actions.
* Translate Transcript tool calls and tool outputs into Gemini Content
  parts, preserving thought signatures from reasoning models and
  flushing buffered reasoning thoughts cleanly.
* Unpack structured tool responses and wrap scalar text tool outputs
  under the result field.
* Support parameterless tools with empty arguments across request
  schema translation, model response handling, and transcript history.
* Add unit tests across GeminiLanguageModel, GeminiRequestTranslator,
  and GeminiTranscriptTranslator.
* Add end-to-end integration tests covering single-turn, sequential,
  parallel, disallowed, parameterless, and reasoning tool calling
  across all supported backends.
2026-09-08 18:19:18 -04:00
..