Regenerate GenerateContent data models from Google Discovery Document
revision 20261019 to resolve drift detected by check-data-models CI,
and move server-side tool invocations into Part.PartData.
Data model updates:
- Candidate.FinishReason: Add continuation case for per-request limits.
- Candidate & GenerateContentRequest: Add continuationToken as String
to round-trip opaque tokens without strict base64 decoding.
- GenerateContentRequest: Add outputConfig for Cloud Storage media
persistence (GenerateContentRequestOutputConfig).
- Part: Add toolCall and toolResponse to oneOf definitions in
firebasevertexai-overrides.yaml and map to Part.PartData variants,
removing top-level stored properties to preserve the invariant that
every Part has data.
Tooling:
- Fix 'swift format' invocation on CI.
Add the Python pipeline under `GeminiLanguageModel/scripts/typegen` that
generates the Swift data models in `GeminiAPIDataModels/GenerateContent`
from the Firebase AI Logic Google Discovery Document, so the models can
be regenerated in-tree as the upstream API evolves.
- `upgrade_spec.py` fetches the `v1beta` Discovery Document, converts it
to OpenAPI 3.1.0, extracts shared standalone enums per backend, infers
required properties, and merges the schema overrides from
`discovery_documents/firebasevertexai-overrides.yaml`.
- `generate_types.py` (the `swift_typegen` package) strips the Gemini
Developer API and Gemini Enterprise Agent Platform prefixes, resolves
the schemas reachable from the request/response roots, merges both
backends with DocC availability callouts, checks for value-type
cycles, renders Swift via Jinja2 templates, runs `swift-format`, and
prunes stale generated files while preserving hand-written ones.
- Add 117 unit tests covering every pipeline stage, and `pyink` settings
in `pyproject.toml`.
- Add a `check-data-models` CI job that runs the unit tests and warns
when the committed data models are behind the Discovery Document.
- Add `Shared/Buildable.swift`, which the regenerated types depend on.
The `GenerateContent` sources are not regenerated here; that follows in
a separate PR.