This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
C# SDK for the AI21 AI platform, auto-generated from the AI21 OpenAPI specification using AutoSDK. Published as a NuGet package under the AI21 package name.
# Build the solution
dotnet build AI21.slnx
# Build for release (also produces NuGet package)
dotnet build AI21.slnx -c Release
# Run integration tests (requires AI21_API_KEY env var)
dotnet test src/tests/AI21.IntegrationTests/AI21.IntegrationTests.csproj
# Regenerate SDK from OpenAPI spec
cd src/libs/AI21 && ./generate.shThe SDK code is entirely auto-generated -- do not manually edit files in src/libs/AI21/Generated/.
src/libs/AI21/openapi.yaml-- the AI21 OpenAPI spec (fetched fromhttps://api.ai21.com/openapi.json)src/helpers/FixOpenApiSpec/-- converts OpenAPI 3.1 to 3.0 format for compatibilitysrc/libs/AI21/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/AI21/ |
Main SDK library (Ai21Client) |
src/tests/AI21.IntegrationTests/ |
Integration tests against real AI21 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
- No hand-written extension files -- the SDK is purely generated code
- The client class is named
Ai21Client - The namespace is
AI21
- Uses shared workflows from
HavenDV/workflowsrepo - Dependabot updates NuGet packages weekly (auto-merged)
- Documentation deployed to GitHub Pages via MkDocs Material