Skip to content

Commit 471f301

Browse files
feat(api): Add support for claude-mythos-preview
1 parent 364ea9e commit 471f301

File tree

8 files changed

+32
-6
lines changed

8 files changed

+32
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 31
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-efe26b096126c693462514b8cbd3ec3e376569232becbfb730cd26fb31c7c7e3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-04225437444990f383d0581df2f07022baab6ad510de0f3a8bd6b07c38d83cc9.yml
33
openapi_spec_hash: cae9199aabfd7b87f0ff2dcc10760c92
4-
config_hash: e1ebf6470ea96e5b7bf02520fbeeed0a
4+
config_hash: fcc34074db6eaf64bc99b578c6c82c61

src/Beta/Messages/Batches/BatchCreateParams/Request/Params.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ final class Params implements BaseModel
264264
public string|array|null $system;
265265

266266
/**
267+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
268+
*
267269
* Amount of randomness injected into the response.
268270
*
269271
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
@@ -362,6 +364,8 @@ final class Params implements BaseModel
362364
public ?array $tools;
363365

364366
/**
367+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
368+
*
365369
* Only sample from the top K options for each subsequent token.
366370
*
367371
* Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
@@ -372,6 +376,8 @@ final class Params implements BaseModel
372376
public ?int $topK;
373377

374378
/**
379+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
380+
*
375381
* Use nucleus sampling.
376382
*
377383
* In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.

src/Beta/Messages/MessageCreateParams.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ final class MessageCreateParams implements BaseModel
245245
public string|array|null $system;
246246

247247
/**
248+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
249+
*
248250
* Amount of randomness injected into the response.
249251
*
250252
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
@@ -343,6 +345,8 @@ final class MessageCreateParams implements BaseModel
343345
public ?array $tools;
344346

345347
/**
348+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
349+
*
346350
* Only sample from the top K options for each subsequent token.
347351
*
348352
* Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
@@ -353,6 +357,8 @@ final class MessageCreateParams implements BaseModel
353357
public ?int $topK;
354358

355359
/**
360+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
361+
*
356362
* Use nucleus sampling.
357363
*
358364
* In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.

src/Messages/Batches/BatchCreateParams/Request/Params.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ final class Params implements BaseModel
214214
public string|array|null $system;
215215

216216
/**
217+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
218+
*
217219
* Amount of randomness injected into the response.
218220
*
219221
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
@@ -312,6 +314,8 @@ final class Params implements BaseModel
312314
public ?array $tools;
313315

314316
/**
317+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
318+
*
315319
* Only sample from the top K options for each subsequent token.
316320
*
317321
* Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
@@ -322,6 +326,8 @@ final class Params implements BaseModel
322326
public ?int $topK;
323327

324328
/**
329+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
330+
*
325331
* Use nucleus sampling.
326332
*
327333
* In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.

src/Messages/MessageCreateParams.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ final class MessageCreateParams implements BaseModel
196196
public string|array|null $system;
197197

198198
/**
199+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
200+
*
199201
* Amount of randomness injected into the response.
200202
*
201203
* Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
@@ -294,6 +296,8 @@ final class MessageCreateParams implements BaseModel
294296
public ?array $tools;
295297

296298
/**
299+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
300+
*
297301
* Only sample from the top K options for each subsequent token.
298302
*
299303
* Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
@@ -304,6 +308,8 @@ final class MessageCreateParams implements BaseModel
304308
public ?int $topK;
305309

306310
/**
311+
* @deprecated Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
312+
*
307313
* Use nucleus sampling.
308314
*
309315
* In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both.

src/Messages/Model.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
enum Model: string
1515
{
1616
// Anthropic model identifiers
17+
18+
case CLAUDE_MYTHOS_PREVIEW = 'claude-mythos-preview';
1719

1820
case CLAUDE_OPUS_4_6 = 'claude-opus-4-6';
1921

tests/Services/Beta/MessagesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function testCountTokens(): void
140140
{
141141
$result = $this->client->beta->messages->countTokens(
142142
messages: [['content' => 'string', 'role' => 'user']],
143-
model: 'claude-opus-4-6',
143+
model: 'claude-mythos-preview',
144144
);
145145

146146
// @phpstan-ignore-next-line method.alreadyNarrowedType
@@ -152,7 +152,7 @@ public function testCountTokensWithOptionalParams(): void
152152
{
153153
$result = $this->client->beta->messages->countTokens(
154154
messages: [['content' => 'string', 'role' => 'user']],
155-
model: 'claude-opus-4-6',
155+
model: 'claude-mythos-preview',
156156
cacheControl: ['type' => 'ephemeral', 'ttl' => '5m'],
157157
contextManagement: [
158158
'edits' => [

tests/Services/MessagesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function testCountTokens(): void
109109
{
110110
$result = $this->client->messages->countTokens(
111111
messages: [['content' => 'string', 'role' => 'user']],
112-
model: 'claude-opus-4-6',
112+
model: 'claude-mythos-preview',
113113
);
114114

115115
// @phpstan-ignore-next-line method.alreadyNarrowedType
@@ -121,7 +121,7 @@ public function testCountTokensWithOptionalParams(): void
121121
{
122122
$result = $this->client->messages->countTokens(
123123
messages: [['content' => 'string', 'role' => 'user']],
124-
model: 'claude-opus-4-6',
124+
model: 'claude-mythos-preview',
125125
cacheControl: ['type' => 'ephemeral', 'ttl' => '5m'],
126126
outputConfig: [
127127
'effort' => 'low',

0 commit comments

Comments
 (0)