Skip to content

Commit 42ee3da

Browse files
docs: update examples
1 parent 0c8a8c9 commit 42ee3da

File tree

3 files changed

+48
-48
lines changed

3 files changed

+48
-48
lines changed

tests/api_resources/beta/test_messages.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,11 @@ def test_method_count_tokens(self, client: Anthropic) -> None:
392392
message = client.beta.messages.count_tokens(
393393
messages=[
394394
{
395-
"content": "string",
395+
"content": "Hello, world",
396396
"role": "user",
397397
}
398398
],
399-
model="claude-mythos-preview",
399+
model="claude-opus-4-6",
400400
)
401401
assert_matches_type(BetaMessageTokensCount, message, path=["response"])
402402

@@ -405,11 +405,11 @@ def test_method_count_tokens_with_all_params(self, client: Anthropic) -> None:
405405
message = client.beta.messages.count_tokens(
406406
messages=[
407407
{
408-
"content": "string",
408+
"content": "Hello, world",
409409
"role": "user",
410410
}
411411
],
412-
model="claude-mythos-preview",
412+
model="claude-opus-4-6",
413413
cache_control={
414414
"type": "ephemeral",
415415
"ttl": "5m",
@@ -516,11 +516,11 @@ def test_raw_response_count_tokens(self, client: Anthropic) -> None:
516516
response = client.beta.messages.with_raw_response.count_tokens(
517517
messages=[
518518
{
519-
"content": "string",
519+
"content": "Hello, world",
520520
"role": "user",
521521
}
522522
],
523-
model="claude-mythos-preview",
523+
model="claude-opus-4-6",
524524
)
525525

526526
assert response.is_closed is True
@@ -533,11 +533,11 @@ def test_streaming_response_count_tokens(self, client: Anthropic) -> None:
533533
with client.beta.messages.with_streaming_response.count_tokens(
534534
messages=[
535535
{
536-
"content": "string",
536+
"content": "Hello, world",
537537
"role": "user",
538538
}
539539
],
540-
model="claude-mythos-preview",
540+
model="claude-opus-4-6",
541541
) as response:
542542
assert not response.is_closed
543543
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -941,11 +941,11 @@ async def test_method_count_tokens(self, async_client: AsyncAnthropic) -> None:
941941
message = await async_client.beta.messages.count_tokens(
942942
messages=[
943943
{
944-
"content": "string",
944+
"content": "Hello, world",
945945
"role": "user",
946946
}
947947
],
948-
model="claude-mythos-preview",
948+
model="claude-opus-4-6",
949949
)
950950
assert_matches_type(BetaMessageTokensCount, message, path=["response"])
951951

@@ -954,11 +954,11 @@ async def test_method_count_tokens_with_all_params(self, async_client: AsyncAnth
954954
message = await async_client.beta.messages.count_tokens(
955955
messages=[
956956
{
957-
"content": "string",
957+
"content": "Hello, world",
958958
"role": "user",
959959
}
960960
],
961-
model="claude-mythos-preview",
961+
model="claude-opus-4-6",
962962
cache_control={
963963
"type": "ephemeral",
964964
"ttl": "5m",
@@ -1065,11 +1065,11 @@ async def test_raw_response_count_tokens(self, async_client: AsyncAnthropic) ->
10651065
response = await async_client.beta.messages.with_raw_response.count_tokens(
10661066
messages=[
10671067
{
1068-
"content": "string",
1068+
"content": "Hello, world",
10691069
"role": "user",
10701070
}
10711071
],
1072-
model="claude-mythos-preview",
1072+
model="claude-opus-4-6",
10731073
)
10741074

10751075
assert response.is_closed is True
@@ -1082,11 +1082,11 @@ async def test_streaming_response_count_tokens(self, async_client: AsyncAnthropi
10821082
async with async_client.beta.messages.with_streaming_response.count_tokens(
10831083
messages=[
10841084
{
1085-
"content": "string",
1085+
"content": "Hello, world",
10861086
"role": "user",
10871087
}
10881088
],
1089-
model="claude-mythos-preview",
1089+
model="claude-opus-4-6",
10901090
) as response:
10911091
assert not response.is_closed
10921092
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

tests/api_resources/test_completions.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TestCompletions:
2121
def test_method_create_overload_1(self, client: Anthropic) -> None:
2222
completion = client.completions.create(
2323
max_tokens_to_sample=256,
24-
model="claude-mythos-preview",
24+
model="claude-2.1",
2525
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
2626
)
2727
assert_matches_type(Completion, completion, path=["response"])
@@ -30,7 +30,7 @@ def test_method_create_overload_1(self, client: Anthropic) -> None:
3030
def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> None:
3131
completion = client.completions.create(
3232
max_tokens_to_sample=256,
33-
model="claude-mythos-preview",
33+
model="claude-2.1",
3434
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
3535
metadata={"user_id": "13803d75-b4b5-4c3e-b2a2-6f21399b021b"},
3636
stop_sequences=["string"],
@@ -46,7 +46,7 @@ def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> No
4646
def test_raw_response_create_overload_1(self, client: Anthropic) -> None:
4747
response = client.completions.with_raw_response.create(
4848
max_tokens_to_sample=256,
49-
model="claude-mythos-preview",
49+
model="claude-2.1",
5050
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
5151
)
5252

@@ -59,7 +59,7 @@ def test_raw_response_create_overload_1(self, client: Anthropic) -> None:
5959
def test_streaming_response_create_overload_1(self, client: Anthropic) -> None:
6060
with client.completions.with_streaming_response.create(
6161
max_tokens_to_sample=256,
62-
model="claude-mythos-preview",
62+
model="claude-2.1",
6363
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
6464
) as response:
6565
assert not response.is_closed
@@ -74,7 +74,7 @@ def test_streaming_response_create_overload_1(self, client: Anthropic) -> None:
7474
def test_method_create_overload_2(self, client: Anthropic) -> None:
7575
completion_stream = client.completions.create(
7676
max_tokens_to_sample=256,
77-
model="claude-mythos-preview",
77+
model="claude-2.1",
7878
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
7979
stream=True,
8080
)
@@ -84,7 +84,7 @@ def test_method_create_overload_2(self, client: Anthropic) -> None:
8484
def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> None:
8585
completion_stream = client.completions.create(
8686
max_tokens_to_sample=256,
87-
model="claude-mythos-preview",
87+
model="claude-2.1",
8888
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
8989
stream=True,
9090
metadata={"user_id": "13803d75-b4b5-4c3e-b2a2-6f21399b021b"},
@@ -100,7 +100,7 @@ def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> No
100100
def test_raw_response_create_overload_2(self, client: Anthropic) -> None:
101101
response = client.completions.with_raw_response.create(
102102
max_tokens_to_sample=256,
103-
model="claude-mythos-preview",
103+
model="claude-2.1",
104104
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
105105
stream=True,
106106
)
@@ -113,7 +113,7 @@ def test_raw_response_create_overload_2(self, client: Anthropic) -> None:
113113
def test_streaming_response_create_overload_2(self, client: Anthropic) -> None:
114114
with client.completions.with_streaming_response.create(
115115
max_tokens_to_sample=256,
116-
model="claude-mythos-preview",
116+
model="claude-2.1",
117117
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
118118
stream=True,
119119
) as response:
@@ -135,7 +135,7 @@ class TestAsyncCompletions:
135135
async def test_method_create_overload_1(self, async_client: AsyncAnthropic) -> None:
136136
completion = await async_client.completions.create(
137137
max_tokens_to_sample=256,
138-
model="claude-mythos-preview",
138+
model="claude-2.1",
139139
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
140140
)
141141
assert_matches_type(Completion, completion, path=["response"])
@@ -144,7 +144,7 @@ async def test_method_create_overload_1(self, async_client: AsyncAnthropic) -> N
144144
async def test_method_create_with_all_params_overload_1(self, async_client: AsyncAnthropic) -> None:
145145
completion = await async_client.completions.create(
146146
max_tokens_to_sample=256,
147-
model="claude-mythos-preview",
147+
model="claude-2.1",
148148
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
149149
metadata={"user_id": "13803d75-b4b5-4c3e-b2a2-6f21399b021b"},
150150
stop_sequences=["string"],
@@ -160,7 +160,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
160160
async def test_raw_response_create_overload_1(self, async_client: AsyncAnthropic) -> None:
161161
response = await async_client.completions.with_raw_response.create(
162162
max_tokens_to_sample=256,
163-
model="claude-mythos-preview",
163+
model="claude-2.1",
164164
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
165165
)
166166

@@ -173,7 +173,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncAnthropic
173173
async def test_streaming_response_create_overload_1(self, async_client: AsyncAnthropic) -> None:
174174
async with async_client.completions.with_streaming_response.create(
175175
max_tokens_to_sample=256,
176-
model="claude-mythos-preview",
176+
model="claude-2.1",
177177
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
178178
) as response:
179179
assert not response.is_closed
@@ -188,7 +188,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncAnt
188188
async def test_method_create_overload_2(self, async_client: AsyncAnthropic) -> None:
189189
completion_stream = await async_client.completions.create(
190190
max_tokens_to_sample=256,
191-
model="claude-mythos-preview",
191+
model="claude-2.1",
192192
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
193193
stream=True,
194194
)
@@ -198,7 +198,7 @@ async def test_method_create_overload_2(self, async_client: AsyncAnthropic) -> N
198198
async def test_method_create_with_all_params_overload_2(self, async_client: AsyncAnthropic) -> None:
199199
completion_stream = await async_client.completions.create(
200200
max_tokens_to_sample=256,
201-
model="claude-mythos-preview",
201+
model="claude-2.1",
202202
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
203203
stream=True,
204204
metadata={"user_id": "13803d75-b4b5-4c3e-b2a2-6f21399b021b"},
@@ -214,7 +214,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
214214
async def test_raw_response_create_overload_2(self, async_client: AsyncAnthropic) -> None:
215215
response = await async_client.completions.with_raw_response.create(
216216
max_tokens_to_sample=256,
217-
model="claude-mythos-preview",
217+
model="claude-2.1",
218218
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
219219
stream=True,
220220
)
@@ -227,7 +227,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncAnthropic
227227
async def test_streaming_response_create_overload_2(self, async_client: AsyncAnthropic) -> None:
228228
async with async_client.completions.with_streaming_response.create(
229229
max_tokens_to_sample=256,
230-
model="claude-mythos-preview",
230+
model="claude-2.1",
231231
prompt="\n\nHuman: Hello, world!\n\nAssistant:",
232232
stream=True,
233233
) as response:

tests/api_resources/test_messages.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ def test_method_count_tokens(self, client: Anthropic) -> None:
314314
message = client.messages.count_tokens(
315315
messages=[
316316
{
317-
"content": "string",
317+
"content": "Hello, world",
318318
"role": "user",
319319
}
320320
],
321-
model="claude-mythos-preview",
321+
model="claude-opus-4-6",
322322
)
323323
assert_matches_type(MessageTokensCount, message, path=["response"])
324324

@@ -327,11 +327,11 @@ def test_method_count_tokens_with_all_params(self, client: Anthropic) -> None:
327327
message = client.messages.count_tokens(
328328
messages=[
329329
{
330-
"content": "string",
330+
"content": "Hello, world",
331331
"role": "user",
332332
}
333333
],
334-
model="claude-mythos-preview",
334+
model="claude-opus-4-6",
335335
cache_control={
336336
"type": "ephemeral",
337337
"ttl": "5m",
@@ -403,11 +403,11 @@ def test_raw_response_count_tokens(self, client: Anthropic) -> None:
403403
response = client.messages.with_raw_response.count_tokens(
404404
messages=[
405405
{
406-
"content": "string",
406+
"content": "Hello, world",
407407
"role": "user",
408408
}
409409
],
410-
model="claude-mythos-preview",
410+
model="claude-opus-4-6",
411411
)
412412

413413
assert response.is_closed is True
@@ -420,11 +420,11 @@ def test_streaming_response_count_tokens(self, client: Anthropic) -> None:
420420
with client.messages.with_streaming_response.count_tokens(
421421
messages=[
422422
{
423-
"content": "string",
423+
"content": "Hello, world",
424424
"role": "user",
425425
}
426426
],
427-
model="claude-mythos-preview",
427+
model="claude-opus-4-6",
428428
) as response:
429429
assert not response.is_closed
430430
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -733,11 +733,11 @@ async def test_method_count_tokens(self, async_client: AsyncAnthropic) -> None:
733733
message = await async_client.messages.count_tokens(
734734
messages=[
735735
{
736-
"content": "string",
736+
"content": "Hello, world",
737737
"role": "user",
738738
}
739739
],
740-
model="claude-mythos-preview",
740+
model="claude-opus-4-6",
741741
)
742742
assert_matches_type(MessageTokensCount, message, path=["response"])
743743

@@ -746,11 +746,11 @@ async def test_method_count_tokens_with_all_params(self, async_client: AsyncAnth
746746
message = await async_client.messages.count_tokens(
747747
messages=[
748748
{
749-
"content": "string",
749+
"content": "Hello, world",
750750
"role": "user",
751751
}
752752
],
753-
model="claude-mythos-preview",
753+
model="claude-opus-4-6",
754754
cache_control={
755755
"type": "ephemeral",
756756
"ttl": "5m",
@@ -822,11 +822,11 @@ async def test_raw_response_count_tokens(self, async_client: AsyncAnthropic) ->
822822
response = await async_client.messages.with_raw_response.count_tokens(
823823
messages=[
824824
{
825-
"content": "string",
825+
"content": "Hello, world",
826826
"role": "user",
827827
}
828828
],
829-
model="claude-mythos-preview",
829+
model="claude-opus-4-6",
830830
)
831831

832832
assert response.is_closed is True
@@ -839,11 +839,11 @@ async def test_streaming_response_count_tokens(self, async_client: AsyncAnthropi
839839
async with async_client.messages.with_streaming_response.count_tokens(
840840
messages=[
841841
{
842-
"content": "string",
842+
"content": "Hello, world",
843843
"role": "user",
844844
}
845845
],
846-
model="claude-mythos-preview",
846+
model="claude-opus-4-6",
847847
) as response:
848848
assert not response.is_closed
849849
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)