Skip to content

Commit 49302d9

Browse files
feat(api): enabling fast-mode in claude-opus-4-6
1 parent 63f412a commit 49302d9

19 files changed

+577
-3
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 32
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-267f913f89364cb8df3a758335a974b43eb98019a8ceef0a9b0a94ef34c2a3b5.yml
3-
openapi_spec_hash: aa708f3d3bc54992526cbf5894427446
4-
config_hash: d56fbaeeb3934b1a3b374590c9837ddd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-fee5dc365a4948e68639582c5301d4d0666c7d85a11628d7917e1477f76d3da1.yml
3+
openapi_spec_hash: d5543958074cd2bd74096cd69f3bb4f9
4+
config_hash: c4802b6c7f8ffae62f7d73b2ac61e635

src/Anthropic.Tests/Models/Beta/AnthropicBetaTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class AnthropicBetaTest : TestBase
2727
[InlineData(AnthropicBeta.ContextManagement2025_06_27)]
2828
[InlineData(AnthropicBeta.ModelContextWindowExceeded2025_08_26)]
2929
[InlineData(AnthropicBeta.Skills2025_10_02)]
30+
[InlineData(AnthropicBeta.FastMode2026_02_01)]
3031
public void Validation_Works(AnthropicBeta rawValue)
3132
{
3233
// force implicit conversion because Theory can't do that for us
@@ -66,6 +67,7 @@ public void InvalidEnumValidationThrows_Works()
6667
[InlineData(AnthropicBeta.ContextManagement2025_06_27)]
6768
[InlineData(AnthropicBeta.ModelContextWindowExceeded2025_08_26)]
6869
[InlineData(AnthropicBeta.Skills2025_10_02)]
70+
[InlineData(AnthropicBeta.FastMode2026_02_01)]
6971
public void SerializationRoundtrip_Works(AnthropicBeta rawValue)
7072
{
7173
// force implicit conversion because Theory can't do that for us

src/Anthropic.Tests/Models/Beta/Messages/Batches/BatchCreateParamsTest.cs

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void FieldRoundtrip_Works()
9090
},
9191
},
9292
ServiceTier = ServiceTier.Auto,
93+
Speed = Speed.Standard,
9394
StopSequences = ["string"],
9495
Stream = true,
9596
System = new(
@@ -224,6 +225,7 @@ public void FieldRoundtrip_Works()
224225
},
225226
},
226227
ServiceTier = ServiceTier.Auto,
228+
Speed = Speed.Standard,
227229
StopSequences = ["string"],
228230
Stream = true,
229231
System = new(
@@ -382,6 +384,7 @@ public void OptionalNonNullableParamsUnsetAreNotSet_Works()
382384
},
383385
},
384386
ServiceTier = ServiceTier.Auto,
387+
Speed = Speed.Standard,
385388
StopSequences = ["string"],
386389
Stream = true,
387390
System = new(
@@ -528,6 +531,7 @@ public void OptionalNonNullableParamsSetToNullAreNotSet_Works()
528531
},
529532
},
530533
ServiceTier = ServiceTier.Auto,
534+
Speed = Speed.Standard,
531535
StopSequences = ["string"],
532536
Stream = true,
533537
System = new(
@@ -677,6 +681,7 @@ public void Url_Works()
677681
},
678682
},
679683
ServiceTier = ServiceTier.Auto,
684+
Speed = Speed.Standard,
680685
StopSequences = ["string"],
681686
Stream = true,
682687
System = new(
@@ -825,6 +830,7 @@ public void AddHeadersToRequest_Works()
825830
},
826831
},
827832
ServiceTier = ServiceTier.Auto,
833+
Speed = Speed.Standard,
828834
StopSequences = ["string"],
829835
Stream = true,
830836
System = new(
@@ -976,6 +982,7 @@ public void CopyConstructor_Works()
976982
},
977983
},
978984
ServiceTier = ServiceTier.Auto,
985+
Speed = Speed.Standard,
979986
StopSequences = ["string"],
980987
Stream = true,
981988
System = new(
@@ -1119,6 +1126,7 @@ public void FieldRoundtrip_Works()
11191126
},
11201127
},
11211128
ServiceTier = ServiceTier.Auto,
1129+
Speed = Speed.Standard,
11221130
StopSequences = ["string"],
11231131
Stream = true,
11241132
System = new(
@@ -1243,6 +1251,7 @@ public void FieldRoundtrip_Works()
12431251
},
12441252
},
12451253
ServiceTier = ServiceTier.Auto,
1254+
Speed = Speed.Standard,
12461255
StopSequences = ["string"],
12471256
Stream = true,
12481257
System = new(
@@ -1375,6 +1384,7 @@ public void SerializationRoundtrip_Works()
13751384
},
13761385
},
13771386
ServiceTier = ServiceTier.Auto,
1387+
Speed = Speed.Standard,
13781388
StopSequences = ["string"],
13791389
Stream = true,
13801390
System = new(
@@ -1510,6 +1520,7 @@ public void FieldRoundtripThroughSerialization_Works()
15101520
},
15111521
},
15121522
ServiceTier = ServiceTier.Auto,
1523+
Speed = Speed.Standard,
15131524
StopSequences = ["string"],
15141525
Stream = true,
15151526
System = new(
@@ -1641,6 +1652,7 @@ public void FieldRoundtripThroughSerialization_Works()
16411652
},
16421653
},
16431654
ServiceTier = ServiceTier.Auto,
1655+
Speed = Speed.Standard,
16441656
StopSequences = ["string"],
16451657
Stream = true,
16461658
System = new(
@@ -1773,6 +1785,7 @@ public void Validation_Works()
17731785
},
17741786
},
17751787
ServiceTier = ServiceTier.Auto,
1788+
Speed = Speed.Standard,
17761789
StopSequences = ["string"],
17771790
Stream = true,
17781791
System = new(
@@ -1905,6 +1918,7 @@ public void CopyConstructor_Works()
19051918
},
19061919
},
19071920
ServiceTier = ServiceTier.Auto,
1921+
Speed = Speed.Standard,
19081922
StopSequences = ["string"],
19091923
Stream = true,
19101924
System = new(
@@ -2039,6 +2053,7 @@ public void FieldRoundtrip_Works()
20392053
},
20402054
},
20412055
ServiceTier = ServiceTier.Auto,
2056+
Speed = Speed.Standard,
20422057
StopSequences = ["string"],
20432058
Stream = true,
20442059
System = new(
@@ -2165,6 +2180,7 @@ public void FieldRoundtrip_Works()
21652180
},
21662181
};
21672182
ApiEnum<string, ServiceTier> expectedServiceTier = ServiceTier.Auto;
2183+
ApiEnum<string, Speed> expectedSpeed = Speed.Standard;
21682184
List<string> expectedStopSequences = ["string"];
21692185
bool expectedStream = true;
21702186
ParamsSystem expectedSystem = new(
@@ -2247,6 +2263,7 @@ public void FieldRoundtrip_Works()
22472263
Assert.Equal(expectedOutputConfig, model.OutputConfig);
22482264
Assert.Equal(expectedOutputFormat, model.OutputFormat);
22492265
Assert.Equal(expectedServiceTier, model.ServiceTier);
2266+
Assert.Equal(expectedSpeed, model.Speed);
22502267
Assert.NotNull(model.StopSequences);
22512268
Assert.Equal(expectedStopSequences.Count, model.StopSequences.Count);
22522269
for (int i = 0; i < expectedStopSequences.Count; i++)
@@ -2334,6 +2351,7 @@ public void SerializationRoundtrip_Works()
23342351
},
23352352
},
23362353
ServiceTier = ServiceTier.Auto,
2354+
Speed = Speed.Standard,
23372355
StopSequences = ["string"],
23382356
Stream = true,
23392357
System = new(
@@ -2465,6 +2483,7 @@ public void FieldRoundtripThroughSerialization_Works()
24652483
},
24662484
},
24672485
ServiceTier = ServiceTier.Auto,
2486+
Speed = Speed.Standard,
24682487
StopSequences = ["string"],
24692488
Stream = true,
24702489
System = new(
@@ -2595,6 +2614,7 @@ public void FieldRoundtripThroughSerialization_Works()
25952614
},
25962615
};
25972616
ApiEnum<string, ServiceTier> expectedServiceTier = ServiceTier.Auto;
2617+
ApiEnum<string, Speed> expectedSpeed = Speed.Standard;
25982618
List<string> expectedStopSequences = ["string"];
25992619
bool expectedStream = true;
26002620
ParamsSystem expectedSystem = new(
@@ -2677,6 +2697,7 @@ public void FieldRoundtripThroughSerialization_Works()
26772697
Assert.Equal(expectedOutputConfig, deserialized.OutputConfig);
26782698
Assert.Equal(expectedOutputFormat, deserialized.OutputFormat);
26792699
Assert.Equal(expectedServiceTier, deserialized.ServiceTier);
2700+
Assert.Equal(expectedSpeed, deserialized.Speed);
26802701
Assert.NotNull(deserialized.StopSequences);
26812702
Assert.Equal(expectedStopSequences.Count, deserialized.StopSequences.Count);
26822703
for (int i = 0; i < expectedStopSequences.Count; i++)
@@ -2764,6 +2785,7 @@ public void Validation_Works()
27642785
},
27652786
},
27662787
ServiceTier = ServiceTier.Auto,
2788+
Speed = Speed.Standard,
27672789
StopSequences = ["string"],
27682790
Stream = true,
27692791
System = new(
@@ -2869,6 +2891,7 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works()
28692891
{ "foo", JsonSerializer.SerializeToElement("bar") },
28702892
},
28712893
},
2894+
Speed = Speed.Standard,
28722895
};
28732896

28742897
Assert.Null(model.McpServers);
@@ -2942,6 +2965,7 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works()
29422965
{ "foo", JsonSerializer.SerializeToElement("bar") },
29432966
},
29442967
},
2968+
Speed = Speed.Standard,
29452969
};
29462970

29472971
model.Validate();
@@ -2990,6 +3014,7 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works()
29903014
{ "foo", JsonSerializer.SerializeToElement("bar") },
29913015
},
29923016
},
3017+
Speed = Speed.Standard,
29933018

29943019
// Null should be interpreted as omitted for these properties
29953020
McpServers = null,
@@ -3078,6 +3103,7 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works()
30783103
{ "foo", JsonSerializer.SerializeToElement("bar") },
30793104
},
30803105
},
3106+
Speed = Speed.Standard,
30813107

30823108
// Null should be interpreted as omitted for these properties
30833109
McpServers = null,
@@ -3196,6 +3222,8 @@ public void OptionalNullablePropertiesUnsetAreNotSet_Works()
31963222
Assert.False(model.RawData.ContainsKey("inference_geo"));
31973223
Assert.Null(model.OutputFormat);
31983224
Assert.False(model.RawData.ContainsKey("output_format"));
3225+
Assert.Null(model.Speed);
3226+
Assert.False(model.RawData.ContainsKey("speed"));
31993227
}
32003228

32013229
[Fact]
@@ -3384,6 +3412,7 @@ public void OptionalNullablePropertiesSetToNullAreSetToNull_Works()
33843412
ContextManagement = null,
33853413
InferenceGeo = null,
33863414
OutputFormat = null,
3415+
Speed = null,
33873416
};
33883417

33893418
Assert.Null(model.Container);
@@ -3394,6 +3423,8 @@ public void OptionalNullablePropertiesSetToNullAreSetToNull_Works()
33943423
Assert.True(model.RawData.ContainsKey("inference_geo"));
33953424
Assert.Null(model.OutputFormat);
33963425
Assert.True(model.RawData.ContainsKey("output_format"));
3426+
Assert.Null(model.Speed);
3427+
Assert.True(model.RawData.ContainsKey("speed"));
33973428
}
33983429

33993430
[Fact]
@@ -3489,6 +3520,7 @@ public void OptionalNullablePropertiesSetToNullValidation_Works()
34893520
ContextManagement = null,
34903521
InferenceGeo = null,
34913522
OutputFormat = null,
3523+
Speed = null,
34923524
};
34933525

34943526
model.Validate();
@@ -3560,6 +3592,7 @@ public void CopyConstructor_Works()
35603592
},
35613593
},
35623594
ServiceTier = ServiceTier.Auto,
3595+
Speed = Speed.Standard,
35633596
StopSequences = ["string"],
35643597
Stream = true,
35653598
System = new(
@@ -3750,6 +3783,64 @@ public void InvalidEnumSerializationRoundtrip_Works()
37503783
}
37513784
}
37523785

3786+
public class SpeedTest : TestBase
3787+
{
3788+
[Theory]
3789+
[InlineData(Speed.Standard)]
3790+
[InlineData(Speed.Fast)]
3791+
public void Validation_Works(Speed rawValue)
3792+
{
3793+
// force implicit conversion because Theory can't do that for us
3794+
ApiEnum<string, Speed> value = rawValue;
3795+
value.Validate();
3796+
}
3797+
3798+
[Fact]
3799+
public void InvalidEnumValidationThrows_Works()
3800+
{
3801+
var value = JsonSerializer.Deserialize<ApiEnum<string, Speed>>(
3802+
JsonSerializer.SerializeToElement("invalid value"),
3803+
ModelBase.SerializerOptions
3804+
);
3805+
3806+
Assert.NotNull(value);
3807+
Assert.Throws<AnthropicInvalidDataException>(() => value.Validate());
3808+
}
3809+
3810+
[Theory]
3811+
[InlineData(Speed.Standard)]
3812+
[InlineData(Speed.Fast)]
3813+
public void SerializationRoundtrip_Works(Speed rawValue)
3814+
{
3815+
// force implicit conversion because Theory can't do that for us
3816+
ApiEnum<string, Speed> value = rawValue;
3817+
3818+
string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions);
3819+
var deserialized = JsonSerializer.Deserialize<ApiEnum<string, Speed>>(
3820+
json,
3821+
ModelBase.SerializerOptions
3822+
);
3823+
3824+
Assert.Equal(value, deserialized);
3825+
}
3826+
3827+
[Fact]
3828+
public void InvalidEnumSerializationRoundtrip_Works()
3829+
{
3830+
var value = JsonSerializer.Deserialize<ApiEnum<string, Speed>>(
3831+
JsonSerializer.SerializeToElement("invalid value"),
3832+
ModelBase.SerializerOptions
3833+
);
3834+
string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions);
3835+
var deserialized = JsonSerializer.Deserialize<ApiEnum<string, Speed>>(
3836+
json,
3837+
ModelBase.SerializerOptions
3838+
);
3839+
3840+
Assert.Equal(value, deserialized);
3841+
}
3842+
}
3843+
37533844
public class ParamsSystemTest : TestBase
37543845
{
37553846
[Fact]

src/Anthropic.Tests/Models/Beta/Messages/Batches/BetaMessageBatchIndividualResponseTest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public void FieldRoundtrip_Works()
9393
OutputTokens = 503,
9494
ServerToolUse = new() { WebFetchRequests = 2, WebSearchRequests = 0 },
9595
ServiceTier = Messages::BetaUsageServiceTier.Standard,
96+
Speed = Messages::BetaUsageSpeed.Standard,
9697
},
9798
}
9899
),
@@ -177,6 +178,7 @@ public void FieldRoundtrip_Works()
177178
OutputTokens = 503,
178179
ServerToolUse = new() { WebFetchRequests = 2, WebSearchRequests = 0 },
179180
ServiceTier = Messages::BetaUsageServiceTier.Standard,
181+
Speed = Messages::BetaUsageSpeed.Standard,
180182
},
181183
}
182184
);
@@ -269,6 +271,7 @@ public void SerializationRoundtrip_Works()
269271
OutputTokens = 503,
270272
ServerToolUse = new() { WebFetchRequests = 2, WebSearchRequests = 0 },
271273
ServiceTier = Messages::BetaUsageServiceTier.Standard,
274+
Speed = Messages::BetaUsageSpeed.Standard,
272275
},
273276
}
274277
),
@@ -367,6 +370,7 @@ public void FieldRoundtripThroughSerialization_Works()
367370
OutputTokens = 503,
368371
ServerToolUse = new() { WebFetchRequests = 2, WebSearchRequests = 0 },
369372
ServiceTier = Messages::BetaUsageServiceTier.Standard,
373+
Speed = Messages::BetaUsageSpeed.Standard,
370374
},
371375
}
372376
),
@@ -458,6 +462,7 @@ public void FieldRoundtripThroughSerialization_Works()
458462
OutputTokens = 503,
459463
ServerToolUse = new() { WebFetchRequests = 2, WebSearchRequests = 0 },
460464
ServiceTier = Messages::BetaUsageServiceTier.Standard,
465+
Speed = Messages::BetaUsageSpeed.Standard,
461466
},
462467
}
463468
);
@@ -550,6 +555,7 @@ public void Validation_Works()
550555
OutputTokens = 503,
551556
ServerToolUse = new() { WebFetchRequests = 2, WebSearchRequests = 0 },
552557
ServiceTier = Messages::BetaUsageServiceTier.Standard,
558+
Speed = Messages::BetaUsageSpeed.Standard,
553559
},
554560
}
555561
),
@@ -642,6 +648,7 @@ public void CopyConstructor_Works()
642648
OutputTokens = 503,
643649
ServerToolUse = new() { WebFetchRequests = 2, WebSearchRequests = 0 },
644650
ServiceTier = Messages::BetaUsageServiceTier.Standard,
651+
Speed = Messages::BetaUsageSpeed.Standard,
645652
},
646653
}
647654
),

0 commit comments

Comments
 (0)