Default to VALIDATED function calling mode in GeminiLanguageModel and
switch guided generation to responseJsonSchema.
Previously, tool-calling requests mapped the default or allowed mode to
AUTO, which does not strictly enforce parameter schemas. Because Swift
decodes tool arguments strictly, schema malformation results in failed
turns. Additionally, guided generation used responseFormat, which the
Gemini backend ignores when VALIDATED mode is active during tool-calling
sessions, dropping response schemas and causing structured decoding
failures in respond(to:generating:).
* Default unset and explicit .allowed toolCallingMode to VALIDATED mode
to strictly enforce schema adherence via constrained decoding.
* Throw LanguageModelError.unsupportedCapability on unrecognized future
tool calling modes instead of silently falling back to allowed.
* Omit functionCallingConfig entirely when requests declare no functions
to avoid contradictory constrained decoding states.
* Send responseJsonSchema with application/json MIME type for guided
generation, which constrained decoding honors alongside VALIDATED.
* Remove unused _responseJsonSchema property from GenerationConfig.
* End SSE response streams and cancel tasks upon receiving terminal
finish reasons or prompt feedback block reasons.
* Add integration test for combined tool calling and guided generation.
* Refresh cached App Check debug tokens proactively within TTL window.
Establishes the integration testing foundation and parameterized test
suites for `GeminiLanguageModel`, enabling fast local execution via
`swift test` and automated CI verification on iOS Simulator.
Key Changes:
- `IntegrationTestingBackend`: Defines canonical backend configurations
(`.developerAPI`, `.firebaseAILogicDeveloperAPI`, and
`.firebaseAILogicAgentPlatform`), dynamically resolving endpoints,
model resource paths, and auth headers from available credentials.
- `IntegrationTestEnvironment`: Centralizes credential discovery
(`GEMINI_API_KEY`, `GOOGLE_API_KEY`, and `FIREBASE_PLIST_PATH`) into
an immutable, thread-safe configuration struct with cached process
access to avoid redundant disk I/O.
- `AppCheckDebugClient`: Implements a lightweight client to exchange
debug tokens for App Check tokens without Keychain dependencies,
deduplicating token requests across test runs with an in-memory cache.
- Parameterized Tests: Adds `BasicContentGenerationIntegrationTests`
running against all available backends, tagged with `@Tag.integration`
and gated by condition traits to cleanly skip when credentials are
missing.
- CI Workflow: Adds `.github/workflows/sdk.geminilanguagemodel.yml` to
run integration tests against Firebase AI Logic on iOS Simulator
using decrypted repo secrets.