Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b0f24aa
feat(api): GA thinking-display-setting
stainless-app[bot] Mar 16, 2026
38c681b
chore(internal): tweak CI branches
stainless-app[bot] Mar 16, 2026
c9d41c1
feat(api): manual updates
stainless-app[bot] Mar 18, 2026
81ab1b8
feat(client): update to M.E.AI.Abstractions 10.4.0 and update with la…
stephentoub Mar 18, 2026
9afe664
fix(client): handle path params correctly in `FromRawUnchecked`
stainless-app[bot] Mar 18, 2026
e093d70
feat(api): manual updates
stainless-app[bot] Mar 18, 2026
5268a2c
fix(client): handle empty messages properly in IChatClient when raw r…
stephentoub Mar 20, 2026
8cbf506
chore(tests): bump steady to v0.19.4
stainless-app[bot] Mar 20, 2026
dcbf8cc
fix: handle oversized SSE events in Bedrock SseEventContentWrapper (#…
scottt732 Mar 20, 2026
56ab27b
fix(client): handle root bodies in requests properly
stainless-app[bot] Mar 20, 2026
d6ddd3a
chore(tests): bump steady to v0.19.5
stainless-app[bot] Mar 20, 2026
de407e6
chore(internal): update gitignore
stainless-app[bot] Mar 23, 2026
4733657
chore(tests): bump steady to v0.19.6
stainless-app[bot] Mar 23, 2026
214a899
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 24, 2026
45ff1d5
chore(tests): bump steady to v0.19.7
stainless-app[bot] Mar 24, 2026
eccbbe6
codegen metadata
stainless-app[bot] Mar 26, 2026
b684235
chore(internal): update multipart form array serialization
stainless-app[bot] Mar 26, 2026
852d5f8
chore(ci): run builds on CI even if only spec metadata changed
stainless-app[bot] Mar 27, 2026
77b2a77
Add output-300k-2026-03-24 beta header
stainless-app[bot] Mar 30, 2026
8f63a96
feat: add ErrorType property to API error exceptions (#760)
renfredxh Mar 30, 2026
fb0390e
chore(tests): bump steady to v0.20.1
stainless-app[bot] Mar 31, 2026
d3e2312
fix(client): allow cancelling when enumerating over an http response
stainless-app[bot] Mar 31, 2026
1178915
fix(client): don't overzealously validate union variants when deseria…
stainless-app[bot] Mar 31, 2026
dd5f734
chore: release main
stainless-app[bot] Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/anthropic-csharp' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork)

steps:
- uses: actions/checkout@v6
Expand All @@ -36,7 +38,7 @@ jobs:
timeout-minutes: 10
name: build
runs-on: ${{ github.repository == 'stainless-sdks/anthropic-csharp' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork)

steps:
- uses: actions/checkout@v6
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
bin/
obj/
.vs/
Expand Down
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"src/Anthropic": "12.9.0",
"src/Anthropic": "12.10.0",
"src/Anthropic.Foundry": "0.5.0",
"src/Anthropic.Bedrock": "0.1.0",
"src/Anthropic.Bedrock": "0.1.1",
"src/Anthropic.Vertex": "0.1.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 33
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-3f1132b9be2d8218a7255103c40a0fbfc2b6d65db76f160db4477f9221493561.yml
openapi_spec_hash: 58021ab18daccd5c45a930ffd7d6ab4d
config_hash: 6debadaa8ff30c5b5ee61176ef42a5fc
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-3088a13fc94214c1b39c66c09fe0af997aed84b412f2fda478af89a9c016f3e6.yml
openapi_spec_hash: ebeeaa9a9bf7603f0bbcce30389e27ca
config_hash: 6f5727994013c43f452e6ac0b4d5e92a
6 changes: 3 additions & 3 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}"
# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
# Pre-install the package so the download doesn't eat into the startup timeout
npm exec --package=@stdy/cli@0.19.3 -- steady --version
npm exec --package=@stdy/cli@0.20.1 -- steady --version

npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets "$URL" &> .stdy.log &
npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log &

# Wait for server to come online via health endpoint (max 30s)
echo -n "Waiting for server"
Expand Down Expand Up @@ -53,5 +53,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets "$URL"
npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL"
fi
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ elif ! prism_is_running ; then
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets${NC}"
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}"
echo

exit 1
Expand Down
6 changes: 5 additions & 1 deletion src/Anthropic.Bedrock/Anthropic.Bedrock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
<LangVersion>13.0</LangVersion>

<PackageId>Anthropic.Bedrock</PackageId>
<VersionPrefix>0.1.0</VersionPrefix>
<VersionPrefix>0.1.1</VersionPrefix>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="Anthropic.Tests,PublicKey=002400000480000094000000060200000024000052534131000400000100010063a3c9395e3d40be5b18dc9c4104236f7a42b63f7fee034f73dcfdb09a677d5bb552f6ffe35d580da1195fd5098ee99affcd842ceeca7973611c3eae10bafa96159ecf8bdd0252ac670b49ffaefd8986a272897cf68b9b1b3e0372dcabff785d5c6c90eab31633416d812ad7f899cc70a2ffc6d869580694017cab7e8c97f4b6"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.Memory" Version="10.0.4"/>
<ProjectReference Include="..\Anthropic\Anthropic.csproj"/>
Expand Down
8 changes: 8 additions & 0 deletions src/Anthropic.Bedrock/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.1 (2026-03-31)

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

### Bug Fixes

* handle oversized SSE events in Bedrock SseEventContentWrapper ([#147](https://github.com/anthropics/anthropic-sdk-csharp/issues/147)) ([dcbf8cc](https://github.com/anthropics/anthropic-sdk-csharp/commit/dcbf8ccb4dc4f1d67fe85e3ff1248517bea6af23))

## 0.1.0 (2026-03-16)

Full Changelog: [Bedrock-v0.0.1...Bedrock-v0.1.0](https://github.com/anthropics/anthropic-sdk-csharp/compare/Bedrock-v0.0.1...Bedrock-v0.1.0)
Expand Down
37 changes: 33 additions & 4 deletions src/Anthropic.Bedrock/SseEventContentWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected override bool TryComputeLength(out long length)
private class SseLazyEventStream : Stream
{
private readonly Stream _sourceStream;
private Memory<byte> _remainder = Memory<byte>.Empty;

public SseLazyEventStream(Stream source)
{
Expand All @@ -69,6 +70,15 @@ public override async ValueTask<int> ReadAsync(
CancellationToken cancellationToken = default
)
{
// Return buffered remainder from a previous oversized event first
if (_remainder.Length > 0)
{
var toCopy = Math.Min(_remainder.Length, buffer.Length);
_remainder[..toCopy].CopyTo(buffer);
_remainder = _remainder[toCopy..];
return toCopy;
}

var (data, success) = await AwsEventStreamHelpers
.ReadStreamMessage(_sourceStream, cancellationToken)
.ConfigureAwait(false);
Expand All @@ -78,8 +88,13 @@ public override async ValueTask<int> ReadAsync(
}

var encodedData = Encoding.UTF8.GetBytes(data!);
encodedData.CopyTo(buffer);
return encodedData.Length;
var bytesToCopy = Math.Min(encodedData.Length, buffer.Length);
encodedData.AsMemory(0, bytesToCopy).CopyTo(buffer);
if (bytesToCopy < encodedData.Length)
{
_remainder = encodedData.AsMemory(bytesToCopy);
}
return bytesToCopy;
}
#else
public override async Task<int> ReadAsync(
Expand All @@ -89,6 +104,15 @@ public override async Task<int> ReadAsync(
CancellationToken cancellationToken
)
{
// Return buffered remainder from a previous oversized event first
if (_remainder.Length > 0)
{
var toCopy = Math.Min(_remainder.Length, count);
_remainder[..toCopy].CopyTo(buffer.AsMemory(offset));
_remainder = _remainder[toCopy..];
return toCopy;
}

var (data, success) = await AwsEventStreamHelpers
.ReadStreamMessage(_sourceStream, cancellationToken)
.ConfigureAwait(false);
Expand All @@ -98,8 +122,13 @@ CancellationToken cancellationToken
}

var encodedData = Encoding.UTF8.GetBytes(data!);
encodedData.CopyTo(buffer, offset);
return encodedData.Length;
var bytesToCopy = Math.Min(encodedData.Length, count);
Array.Copy(encodedData, 0, buffer, offset, bytesToCopy);
if (bytesToCopy < encodedData.Length)
{
_remainder = encodedData.AsMemory(bytesToCopy);
}
return bytesToCopy;
}
#endif

Expand Down
Loading
Loading