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