This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
C# SDK for the Cohere AI platform, auto-generated from the official Cohere OpenAPI specification using AutoSDK. Published as a NuGet package under the Cohere package name.
# Build the solution
dotnet build Cohere.slnx
# Build for release (also produces NuGet package)
dotnet build Cohere.slnx -c Release
# Run integration tests (requires COHERE_API_KEY env var)
dotnet test src/tests/Cohere.IntegrationTests/Cohere.IntegrationTests.csproj
# Regenerate SDK from OpenAPI spec
cd src/libs/Cohere && ./generate.shThe SDK code is entirely auto-generated -- do not manually edit files in src/libs/Cohere/Generated/.
src/libs/Cohere/openapi.yaml-- the Cohere OpenAPI spec (fetched from thecohere-developer-experiencerepo)src/libs/Cohere/generate.sh-- orchestrates: download the official spec, run AutoSDK CLI, output toGenerated/- CI auto-updates the spec and creates PRs if changes are detected
| Project | Purpose |
|---|---|
src/libs/Cohere/ |
Main SDK library (CohereClient) |
src/tests/Cohere.IntegrationTests/ |
Integration tests against real Cohere API |
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
CohereClient - The namespace is
Cohere
- Uses shared workflows from
HavenDV/workflowsrepo - Dependabot updates NuGet packages weekly (auto-merged)
- Documentation deployed to GitHub Pages via MkDocs Material