You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
C# SDK for the [OpenAI](https://openai.com/) API, auto-generated from the official OpenAI OpenAPI specification using [AutoSDK](https://github.com/tryAGI/AutoSDK). Published as the `tryAGI.OpenAI` NuGet package. Includes support for custom providers (Azure, DeepSeek, Groq, Ollama, OpenRouter, Together, and many more), a source generator for native C# function/tool definitions, pricing constants, and structured output helpers.
8
+
9
+
## Build Commands
10
+
11
+
```bash
12
+
# Build the solution
13
+
dotnet build OpenAI.sln
14
+
15
+
# Build for release (also produces NuGet package)
16
+
dotnet build OpenAI.sln -c Release
17
+
18
+
# Run integration tests (requires OPENAI_API_KEY env var)
19
+
dotnet test src/tests/OpenAI.IntegrationTests/OpenAI.IntegrationTests.csproj
20
+
21
+
# Run snapshot tests for CSharpToJsonSchema
22
+
dotnet test src/tests/CSharpToJsonSchema.SnapshotTests/CSharpToJsonSchema.SnapshotTests.csproj
23
+
24
+
# Run unit tests for CSharpToJsonSchema
25
+
dotnet test src/tests/CSharpToJsonSchema.UnitTests/CSharpToJsonSchema.UnitTests.csproj
26
+
27
+
# Regenerate SDK from OpenAPI spec
28
+
cd src/libs/tryAGI.OpenAI && ./generate.sh
29
+
```
30
+
31
+
## Architecture
32
+
33
+
### Code Generation Pipeline
34
+
35
+
The SDK code in `Generated/` is **auto-generated** -- do not manually edit files in `src/libs/tryAGI.OpenAI/Generated/`.
36
+
37
+
1.`src/libs/tryAGI.OpenAI/openapi.yaml` -- the OpenAI OpenAPI spec (fetched from Stainless)
38
+
2.`src/helpers/FixOpenApiSpec/` -- converts OpenAPI 3.1 to 3.0 format for compatibility
39
+
3.`src/libs/tryAGI.OpenAI/generate.sh` -- orchestrates: download spec, fix spec, run AutoSDK CLI, output to `Generated/`
40
+
4. CI auto-updates the spec and creates PRs if changes are detected
41
+
42
+
### Hand-Written Extensions
43
+
44
+
Unlike most other tryAGI SDKs, this repo has significant **hand-written code** alongside the generated code:
45
+
46
+
| Path | Purpose |
47
+
|------|---------|
48
+
|`Metadata/`| Pricing constants and model metadata (chat, embedding, images, TTS, STT) |
49
+
|`Conversions/`| Implicit conversions for `ChatCompletionRequestMessage`, `CreateMessageRequest`, etc. |
0 commit comments