This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
C# SDK for the Google Gemini generative AI API, auto-generated from a curated Google AI OpenAPI specification using AutoSDK. Published as NuGet package Google_Gemini.
# Build the solution
dotnet build Google.Gemini.slnx
# Build for release (also produces NuGet package)
dotnet build Google.Gemini.slnx -c Release
# Run integration tests (reads GOOGLE_GEMINI_API_KEY or API_KEY from env, and also loads a repo-root .env file)
dotnet test src/tests/IntegrationTests/Google.Gemini.IntegrationTests.csproj
# Regenerate SDK from OpenAPI spec
cd src/libs/Google.Gemini && ./generate.shThe SDK code is entirely auto-generated -- do not manually edit files in src/libs/Google.Gemini/Generated/.
src/libs/Google.Gemini/openapi.yaml-- the Google Gemini OpenAPI spec (fetched from a curated spec in thelangchain_dartrepo)src/helpers/FixOpenApiSpec/-- converts OpenAPI 3.1 to 3.0 format for compatibilitysrc/libs/Google.Gemini/generate.sh-- orchestrates: download spec, fix spec, run AutoSDK CLI, output toGenerated/- CI auto-updates the spec and creates PRs if changes are detected
| Project | Purpose |
|---|---|
src/libs/Google.Gemini/ |
Main SDK library (GeminiClient) |
src/tests/IntegrationTests/ |
Integration tests against real Google Gemini API |
src/helpers/FixOpenApiSpec/ |
OpenAPI spec fixer tool |
src/helpers/GenerateDocs/ |
Documentation generator from integration tests |
src/helpers/TrimmingHelper/ |
NativeAOT/trimming compatibility validator |
- Target:
net10.0(single target) - Language: C# preview with nullable reference types
- Signing: Strong-named assemblies via
src/key.snk - Versioning: Semantic versioning from git tags (
vprefix) via MinVer - Analysis: All .NET analyzers enabled, AOT/trimming compatibility enforced
- Testing: MSTest + FluentAssertions
- NuGet Package ID:
Google_Gemini(underscores due to NuGet naming restrictions)
- No hand-written extension files -- the SDK is purely generated code
- The client class is named
GeminiClient - The namespace is
Google.Gemini - Note the NuGet package ID uses underscores (
Google_Gemini) while the namespace uses dots (Google.Gemini) - Integration tests default
generateContentcalls togemini-flash-latest; override withGOOGLE_GEMINI_MODEL_IDwhen needed
- Uses shared workflows from
HavenDV/workflowsrepo - Dependabot updates NuGet packages weekly (auto-merged)
- Documentation deployed to GitHub Pages via MkDocs Material