Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1b0714d
chore(internal): suppress diagnostic for .netstandard2.0
stainless-app[bot] Nov 26, 2025
9ede62d
chore(internal): suppress diagnostic for .netstandard2.0
stainless-app[bot] Nov 26, 2025
9420cfd
fix: remove bad preprocessor directive
TomerAberbach Dec 2, 2025
5b7052c
Add some more tests for Anthropic{Beta}ClientExtensions (#26)
stephentoub Dec 2, 2025
f97af3a
chore(internal): update testing setup
JPVenson Dec 2, 2025
f270a7e
chore(internal): equality and more unit tests
stainless-app[bot] Dec 2, 2025
eb6a775
fix(client): handling of null value type
stainless-app[bot] Dec 2, 2025
6036c7f
chore(internal): update csproj formatting
stainless-app[bot] Dec 1, 2025
b733f32
refactor(client): use `System.Net.ServerSentEvents`
stainless-app[bot] Dec 2, 2025
e2d6db0
docs: add link to nuget
stainless-app[bot] Dec 2, 2025
6e568ec
fix(client): check response status when `MaxRetries = 0`
stainless-app[bot] Dec 2, 2025
25b6f4f
chore(internal): add tests for constants
stainless-app[bot] Dec 2, 2025
267ee6e
feat(internal): add additional object tests
stainless-app[bot] Dec 2, 2025
096a719
codegen metadata
stainless-app[bot] Dec 3, 2025
f482b0d
chore(ci): lint and build examples (#43)
JPVenson Dec 3, 2025
8d28ac4
feat(client): improve some names
stainless-app[bot] Dec 3, 2025
8ade211
docs: add more comments
stainless-app[bot] Dec 3, 2025
b42ce94
fix(client): with expressions for models
stainless-app[bot] Dec 3, 2025
db1339f
chore(internal): fix release please config
meorphis Dec 4, 2025
1131b72
chore(internal): fix package name (#239)
meorphis Dec 4, 2025
ad0fba4
feat(client): add x-stainless-retry-count
stainless-app[bot] Dec 4, 2025
b1778c3
fix(ci): fail loudly if version already exists on nuget
stainless-app[bot] Dec 4, 2025
2b01684
Fix handling of multiple streaming tool calls (#62)
stephentoub Dec 5, 2025
7d02e50
Add beta headers automatically for HostedCodeInterpreter/McpServerToo…
stephentoub Dec 8, 2025
e3028c4
Idiomatic Skills support for MEAI via AsAITool() extension (#58)
PederHP Dec 9, 2025
d891fe0
chore(internal): add enum tests
stainless-app[bot] Dec 10, 2025
d86c38d
chore(client): improve union validation
stainless-app[bot] Dec 10, 2025
647d4ce
chore: release main
stainless-app[bot] Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/workflows/create-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ jobs:
${{ github.workspace }}/artifacts/packages/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key $NUGET_API_KEY
--skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.ANTHROPIC_NUGET_API_KEY || secrets.NUGET_API_KEY }}
1 change: 0 additions & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ jobs:
${{ github.workspace }}/artifacts/packages/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key $NUGET_API_KEY
--skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.ANTHROPIC_NUGET_API_KEY || secrets.NUGET_API_KEY }}
6 changes: 3 additions & 3 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
".": "11.0.0",
"src/Anthropic.Foundry": "0.1.0"
}
"src/Anthropic": "12.0.0",
"src/Anthropic.Foundry": "0.2.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-a49e89deec4e00d1da490808099d66e2001531b12d8666a7f5d0b496f760440d.yml
openapi_spec_hash: c93ef3808c58e233b01966ff154f31ce
config_hash: 0abc2a1f94e35774a88fceb60e703c5f
config_hash: a5d8cd02f9a686d4e0baa7ba652e3e55
310 changes: 310 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The REST API documentation can be found on [docs.anthropic.com](https://docs.ant

## Installation

Install the package from [NuGet](https://www.nuget.org/packages/Anthropic):

```bash
dotnet add package Anthropic
```
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions examples/Anthropic.ClientExample/Anthropic.ClientExample.csproj

This file was deleted.

56 changes: 56 additions & 0 deletions examples/Anthropic.Examples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MessagesExample", "MessagesExample\MessagesExample.csproj", "{FA9BAC30-CC15-4D21-99CF-011D5D082FAF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThinkingStreamingExample", "ThinkingStreamingExample\ThinkingStreamingExample.csproj", "{97BE49BD-B144-4967-8718-C79E4521BA3F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThinkingExample", "ThinkingExample\ThinkingExample.csproj", "{79DCA526-628F-413B-83DA-F1B92029C065}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MessagesStreamingExample", "MessagesStreamingExample\MessagesStreamingExample.csproj", "{8CD54CE9-894F-4636-8CAF-D20914CF4014}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatClientExample", "ChatClientExample\ChatClientExample.csproj", "{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -27,6 +35,54 @@ Global
{FA9BAC30-CC15-4D21-99CF-011D5D082FAF}.Release|x64.Build.0 = Release|Any CPU
{FA9BAC30-CC15-4D21-99CF-011D5D082FAF}.Release|x86.ActiveCfg = Release|Any CPU
{FA9BAC30-CC15-4D21-99CF-011D5D082FAF}.Release|x86.Build.0 = Release|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Debug|x64.ActiveCfg = Debug|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Debug|x64.Build.0 = Debug|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Debug|x86.ActiveCfg = Debug|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Debug|x86.Build.0 = Debug|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Release|Any CPU.Build.0 = Release|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Release|x64.ActiveCfg = Release|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Release|x64.Build.0 = Release|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Release|x86.ActiveCfg = Release|Any CPU
{97BE49BD-B144-4967-8718-C79E4521BA3F}.Release|x86.Build.0 = Release|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Debug|x64.ActiveCfg = Debug|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Debug|x64.Build.0 = Debug|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Debug|x86.ActiveCfg = Debug|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Debug|x86.Build.0 = Debug|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Release|Any CPU.Build.0 = Release|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Release|x64.ActiveCfg = Release|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Release|x64.Build.0 = Release|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Release|x86.ActiveCfg = Release|Any CPU
{79DCA526-628F-413B-83DA-F1B92029C065}.Release|x86.Build.0 = Release|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Debug|x64.ActiveCfg = Debug|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Debug|x64.Build.0 = Debug|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Debug|x86.ActiveCfg = Debug|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Debug|x86.Build.0 = Debug|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Release|Any CPU.Build.0 = Release|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Release|x64.ActiveCfg = Release|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Release|x64.Build.0 = Release|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Release|x86.ActiveCfg = Release|Any CPU
{8CD54CE9-894F-4636-8CAF-D20914CF4014}.Release|x86.Build.0 = Release|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Debug|x64.ActiveCfg = Debug|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Debug|x64.Build.0 = Debug|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Debug|x86.ActiveCfg = Debug|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Debug|x86.Build.0 = Debug|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Release|Any CPU.Build.0 = Release|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Release|x64.ActiveCfg = Release|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Release|x64.Build.0 = Release|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Release|x86.ActiveCfg = Release|Any CPU
{AA6ED2E6-A693-4FD8-AF20-1D339FBFBF96}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 3 additions & 5 deletions examples/MessagesExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using Anthropic;
using Anthropic.Foundry;
using Anthropic;
using Anthropic.Models.Messages;

// Configured using the ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL environment variables
IAnthropicClient client = new AnthropicClient();
var client = new AnthropicClient();

// For using the Foundry client, use this instead
// AnthropicFoundryClient client = new(new AnthropicFoundryApiKeyCredentials("API-TOKEN", "RESOURCE-NAME"));
Expand All @@ -21,7 +19,7 @@

var response = await client.Messages.Create(parameters);

var message = String.Join(
var message = string.Join(
"",
response
.Content.Where(message => message.Value is TextBlock)
Expand Down
5 changes: 1 addition & 4 deletions examples/MessagesStreamingExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using Anthropic;
using Anthropic;
using Anthropic.Models.Messages;
using Anthropic.Models.Messages.ContentBlockVariants;
using Anthropic.Models.Messages.MessageParamProperties;

// Configured using the ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL environment variables
AnthropicClient client = new();
Expand Down
15 changes: 5 additions & 10 deletions examples/ThinkingExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using Anthropic;
using Anthropic;
using Anthropic.Models.Messages;
using Anthropic.Models.Messages.MessageParamProperties;
using ContentBlockVariants = Anthropic.Models.Messages.ContentBlockVariants;

// Configured using the ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL environment variables
AnthropicClient client = new();
Expand All @@ -22,21 +19,19 @@

foreach (ContentBlock block in response.Content)
{
if (block.TryPickThinking(out ThinkingBlock thinking))
if (block.TryPickThinking(out ThinkingBlock? thinking))
{
Console.WriteLine($"Thinking: {thinking.Thinking}");
}
else if (block.TryPickText(out TextBlock text))
else if (block.TryPickText(out TextBlock? text))
{
Console.WriteLine($"Text: {text.Text}");
}
}

var message = String.Join(
var message = string.Join(
"",
response
.Content.OfType<ContentBlockVariants::TextBlock>()
.Select((textBlock) => textBlock.Value.Text)
response.Content.Select(e => e.Value).OfType<TextBlock>().Select((textBlock) => textBlock.Text)
);

Console.WriteLine(message);
4 changes: 1 addition & 3 deletions examples/ThinkingStreamingExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using Anthropic;
using Anthropic;
using Anthropic.Models.Messages;
using Anthropic.Models.Messages.MessageParamProperties;

// Configured using the ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL environment variables
AnthropicClient client = new();
Expand Down
4 changes: 2 additions & 2 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": {
".": {},
"src/Anthropic": {},
"src/Anthropic.Foundry": {}
},
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
Expand Down Expand Up @@ -60,7 +60,7 @@
"hidden": true
}
],
"release-type": "simple",
"release-type": "csharp",
"extra-files": [
{
"type": "xml",
Expand Down
3 changes: 2 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ set -e
cd "$(dirname "$0")/.."

echo "==> Running dotnet build"
dotnet build
dotnet build Anthropic.sln
dotnet build examples/Anthropic.Examples.sln
2 changes: 1 addition & 1 deletion src/Anthropic.Foundry/Anthropic.Foundry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<BuildPackage>true</BuildPackage>
<Deterministic>true</Deterministic>
<PackageId>Anthropic.Foundry</PackageId>
<Version>0.1.0</Version>
<Version>0.2.0</Version>
<Authors>Stainless Software, Inc.</Authors>
<Company>Stainless Software, Inc.</Company>
<PackageProjectUrl>https://github.com/anthropics/anthropic-sdk-csharp</PackageProjectUrl>
Expand Down
29 changes: 29 additions & 0 deletions src/Anthropic.Foundry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## 0.2.0 (2025-12-10)

Full Changelog: [Foundry-v0.1.0...Foundry-v0.2.0](https://github.com/anthropics/anthropic-sdk-csharp/compare/Foundry-v0.1.0...Foundry-v0.2.0)

### Features

* add Foundry client ([5f87e12](https://github.com/anthropics/anthropic-sdk-csharp/commit/5f87e129a262d8a373e5e10bcca4196cf5db0394))
* **client:** additional methods for positional params ([08c27c6](https://github.com/anthropics/anthropic-sdk-csharp/commit/08c27c6a4cb45b886be44babbb51bf4934add374))
* **client:** additional methods for positional params ([8bc6323](https://github.com/anthropics/anthropic-sdk-csharp/commit/8bc6323c38ce551f995bec5e4b1584460b7f037b))


### Bug Fixes

* **client:** return correct type for foundry#WithOptions ([#18](https://github.com/anthropics/anthropic-sdk-csharp/issues/18)) ([9ff2124](https://github.com/anthropics/anthropic-sdk-csharp/commit/9ff2124a9190269ff4a469b6e8c9f6b895f8d2d2))
* **client:** return correct type for foundry#WithOptions ([#18](https://github.com/anthropics/anthropic-sdk-csharp/issues/18)) ([f814a46](https://github.com/anthropics/anthropic-sdk-csharp/commit/f814a460503abf7fdf7a824b5bf446ef74d60f28))
* **internal:** remove release notes from foundry readme ([afeaa2f](https://github.com/anthropics/anthropic-sdk-csharp/commit/afeaa2f526c3818c244bb351b4dad56a59883395))
* use correct versions ([7c97d7f](https://github.com/anthropics/anthropic-sdk-csharp/commit/7c97d7f19c6937a2dacb666b05b9b9d040d677c7))
* use correct versions ([c78c8db](https://github.com/anthropics/anthropic-sdk-csharp/commit/c78c8db4b6effa6b1438bb879bcafdad2d155808))


### Chores

* fix ci ([#196](https://github.com/anthropics/anthropic-sdk-csharp/issues/196)) ([8dede61](https://github.com/anthropics/anthropic-sdk-csharp/commit/8dede6176cb86e1ae85db9c8d0fae50c595ef964))
* **internal:** add logo to nuget package ([#181](https://github.com/anthropics/anthropic-sdk-csharp/issues/181)) ([e01f08d](https://github.com/anthropics/anthropic-sdk-csharp/commit/e01f08dbd35f05c3ecc964eb040312b4f7ca6713))
* **internal:** suppress diagnostic for .netstandard2.0 ([9ede62d](https://github.com/anthropics/anthropic-sdk-csharp/commit/9ede62de370abcad1fc1a5211700a6c967d360ca))
* **internal:** suppress diagnostic for .netstandard2.0 ([1b0714d](https://github.com/anthropics/anthropic-sdk-csharp/commit/1b0714dc78ba2e69ab149d7cf768963379ec73e5))
* sync with release-please ([2f5aa29](https://github.com/anthropics/anthropic-sdk-csharp/commit/2f5aa2992a2d462bb1f547efa09355e4f0b60656))
* sync with release-please ([191236b](https://github.com/anthropics/anthropic-sdk-csharp/commit/191236bf5fb39092a2e2afc062e9cd222b859d2d))

## 0.1.0 (2025-12-01)

Full Changelog: [v0.0.3...v0.1.0](https://github.com/anthropics/anthropic-sdk-csharp/compare/v0.0.3...v0.1.0)
Expand Down
Loading