Skip to content

Commit 7653c37

Browse files
committed
fix(examples): use versioned Seed 2.1 Pro model ID
Sync-Source-Commit: 6094eec300f4d6da881e41ef6e1f78f5b99ba215 Ark-APIs-Commit: 99ec1eeb10274c8924ef526863c09dd4a374a5e3 Hand-Written-Reason: Manual example update (versioned Seed 2.1 Pro model ID). No ark-apis regeneration involved; attributed to the same ark-apis snapshot as parent 6d3231a.
1 parent 532f69c commit 7653c37

12 files changed

Lines changed: 29 additions & 29 deletions

‎README.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ from arkruntime import Ark
2828
client = Ark()
2929

3030
response = client.responses.create(
31-
model=os.environ.get("ARK_MODEL", "doubao-seed-1-6"),
31+
model=os.environ.get("ARK_MODEL", "doubao-seed-2-1-pro-260628"),
3232
input="Explain how large language models work in three sentences.",
3333
)
3434
print(response.output_text)
@@ -43,7 +43,7 @@ from arkruntime import Ark
4343
client = Ark()
4444

4545
completion = client.chat.completions.create(
46-
model=os.environ.get("ARK_MODEL", "doubao-seed-1-6"),
46+
model=os.environ.get("ARK_MODEL", "doubao-seed-2-1-pro-260628"),
4747
messages=[
4848
{"role": "system", "content": "You are a helpful assistant."},
4949
{"role": "user", "content": "Write a haiku about programming."},
@@ -65,7 +65,7 @@ from arkruntime import Ark
6565
client = Ark()
6666

6767
stream = client.responses.create(
68-
model=os.environ.get("ARK_MODEL", "doubao-seed-1-6"),
68+
model=os.environ.get("ARK_MODEL", "doubao-seed-2-1-pro-260628"),
6969
input="Count from 1 to 10 slowly.",
7070
stream=True,
7171
)
@@ -82,7 +82,7 @@ from arkruntime import Ark
8282
client = Ark()
8383

8484
stream = client.chat.completions.create(
85-
model=os.environ.get("ARK_MODEL", "doubao-seed-1-6"),
85+
model=os.environ.get("ARK_MODEL", "doubao-seed-2-1-pro-260628"),
8686
messages=[{"role": "user", "content": "Count from 1 to 10 slowly."}],
8787
stream=True,
8888
)
@@ -104,7 +104,7 @@ client = AsyncArk()
104104

105105
async def main():
106106
response = await client.responses.create(
107-
model=os.environ.get("ARK_MODEL", "doubao-seed-1-6"),
107+
model=os.environ.get("ARK_MODEL", "doubao-seed-2-1-pro-260628"),
108108
input="Explain quantum computing briefly.",
109109
)
110110
print(response.output_text)
@@ -123,7 +123,7 @@ from arkruntime import Ark
123123
client = Ark()
124124

125125
completion = client.chat.completions.create(
126-
model=os.environ.get("ARK_MODEL", "doubao-seed-1-6"),
126+
model=os.environ.get("ARK_MODEL", "doubao-seed-2-1-pro-260628"),
127127
messages=[
128128
{
129129
"role": "user",
@@ -164,7 +164,7 @@ tools = [
164164
]
165165

166166
completion = client.chat.completions.create(
167-
model=os.environ.get("ARK_MODEL", "doubao-seed-1-6"),
167+
model=os.environ.get("ARK_MODEL", "doubao-seed-2-1-pro-260628"),
168168
messages=[{"role": "user", "content": "What is the weather in Beijing?"}],
169169
tools=tools,
170170
)
@@ -205,7 +205,7 @@ client = Ark()
205205

206206
try:
207207
client.chat.completions.create(
208-
model="doubao-seed-1-6",
208+
model="doubao-seed-2-1-pro-260628",
209209
messages=[{"role": "user", "content": "Hello"}],
210210
)
211211
except ArkRateLimitError:
@@ -253,7 +253,7 @@ Per-request overrides are also supported:
253253

254254
```python
255255
client.chat.completions.create(
256-
model="doubao-seed-1-6",
256+
model="doubao-seed-2-1-pro-260628",
257257
messages=[{"role": "user", "content": "Hello"}],
258258
timeout=30.0,
259259
)
@@ -269,7 +269,7 @@ from arkruntime import Ark
269269
client = Ark(timeout=24 * 3600)
270270

271271
result = client.batch.chat.completions.create(
272-
model="doubao-seed-1-6",
272+
model="doubao-seed-2-1-pro-260628",
273273
messages=[{"role": "user", "content": "Hello"}],
274274
)
275275
print(result)

‎examples/agents.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Runs against the outward /api/v3/agents endpoint.
44
55
export ARK_API_KEY=...
6-
export ARK_MODEL_ID=doubao-seed-1-8-251228 # or whatever you have access to
6+
export ARK_MODEL_ID=doubao-seed-2-1-pro-260628 # or whatever you have access to
77
python examples/agents.py
88
"""
99

‎examples/chat/completions.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# To get your ak&sk, please refer to this document(https://www.volcengine.com/docs/6291/65568)
1515
# For more information,please check this document(https://www.volcengine.com/docs/82379/1263279)
1616
client = Ark()
17-
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-1-6")
17+
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-2-1-pro-260628")
1818

1919

2020
if __name__ == "__main__":

‎examples/chat/function_call.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Authentication
1414
# 1.If you authorize your endpoint using an API key, you can set your api key to environment variable "ARK_API_KEY"
1515
client = Ark()
16-
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-1-6")
16+
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-2-1-pro-260628")
1717

1818
WEATHER_TOOL = {
1919
"type": "function",

‎examples/chat/reasoning_completions.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Authentication
66
# 1.If you authorize your endpoint using an API key, you can set your api key to environment variable "ARK_API_KEY"
77
client = Ark()
8-
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-1-6")
8+
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-2-1-pro-260628")
99

1010
if __name__ == "__main__":
1111
# Streaming:

‎examples/chat/structured_output.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Authentication
1919
# 1.If you authorize your endpoint using an API key, you can set your api key to environment variable "ARK_API_KEY"
2020
client = Ark()
21-
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-1-6")
21+
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-2-1-pro-260628")
2222

2323

2424
class MeetingInfo(BaseModel):

‎examples/chat/vision_completions.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# 1.If you authorize your endpoint using an API key, you can set your api key to environment variable "ARK_API_KEY"
77
# or specify api key by Ark(api_key="${YOUR_API_KEY}").
88
client = Ark()
9-
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-1-6")
9+
MODEL = os.environ.get("ENDPOINT_ID", "doubao-seed-2-1-pro-260628")
1010

1111
# Image input:
1212
response = client.chat.completions.create(

‎examples/responses/async_create.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def main():
2828
# ---------- 第 1 轮 ----------
2929
# 说明:开启 caching,store=True 表示把对话存储在服务端,以便后续引用
3030
stream = await client.responses.create(
31-
model="doubao-seed-1-6",
31+
model="doubao-seed-2-1-pro-260628",
3232
input=[
3333
{
3434
"role": "system",
@@ -61,7 +61,7 @@ async def main():
6161
# ---------- 第 2 轮 ----------
6262
# 说明:通过 previous_response_id 关联上一轮的上下文
6363
stream = await client.responses.create(
64-
model="doubao-seed-1-6",
64+
model="doubao-seed-2-1-pro-260628",
6565
previous_response_id=response_id,
6666
input=[
6767
{"role": "user", "content": "上一轮对话里图里的内容是"},
@@ -83,7 +83,7 @@ async def main():
8383
# ---------- 第 1 轮 ----------
8484
# 用户询问北京天气,模型会触发工具调用
8585
stream = await client.responses.create(
86-
model="doubao-seed-1-6",
86+
model="doubao-seed-2-1-pro-260628",
8787
input=[
8888
{"role": "user", "content": "请问北京今天天气怎么样"},
8989
],
@@ -126,7 +126,7 @@ async def main():
126126
# ---------- 第 2 轮 ----------
127127
# 把函数返回结果传回模型,让它继续生成最终回答
128128
stream = await client.responses.create(
129-
model="doubao-seed-1-6",
129+
model="doubao-seed-2-1-pro-260628",
130130
previous_response_id=response_id,
131131
input=[
132132
{
@@ -149,7 +149,7 @@ async def main():
149149
# ==========================================================
150150
print("Example 3: Use responses API for web search")
151151
stream = await client.responses.create(
152-
model="doubao-seed-1-6",
152+
model="doubao-seed-2-1-pro-260628",
153153
input=[
154154
{"role": "user", "content": "今天的新闻"},
155155
],
@@ -178,7 +178,7 @@ async def main():
178178
# ---------- 第 1 轮 ----------
179179
# 用户询问repo信息,模型会触发mcp工具调用
180180
stream = await client.responses.create(
181-
model="doubao-seed-1-6",
181+
model="doubao-seed-2-1-pro-260628",
182182
input=[
183183
{
184184
"role": "user",
@@ -213,7 +213,7 @@ async def main():
213213
# ---------- 第 2 轮 ----------
214214
# 用户同意mcp工具调用,模型会继续生成最终回答
215215
stream = await client.responses.create(
216-
model="doubao-seed-1-6",
216+
model="doubao-seed-2-1-pro-260628",
217217
input=[
218218
{
219219
"type": "mcp_approval_response",

‎examples/responses/async_doubao_app.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async def main():
1919
# ---------- 第 1 轮 ----------
2020
# 选择一种feature 测试
2121
stream = await client.responses.create(
22-
model="doubao-seed-1-6",
22+
model="doubao-seed-2-1-pro-260628",
2323
input=[
2424
{"role": "user", "content": "你好请你介绍你自己"},
2525
],
@@ -48,7 +48,7 @@ async def main():
4848
# ---------- 第 2 轮 ----------
4949
# 说明:通过 previous_response_id 关联上一轮的上下文
5050
stream = await client.responses.create(
51-
model="doubao-seed-1-6",
51+
model="doubao-seed-2-1-pro-260628",
5252
previous_response_id=response_id,
5353
input=[
5454
{"role": "user", "content": "上一轮对话里我们说了什么"},

‎examples/responses/async_video.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def main() -> None:
6161
# ==========================================================
6262
print("\nTurn 1: ask the model to analyze the video frame-by-frame")
6363
stream = await client.responses.create(
64-
model="doubao-seed-1-6",
64+
model="doubao-seed-2-1-pro-260628",
6565
input=[
6666
{"role": "system", "content": "你是豆包,是由字节跳动开发的 AI 人工智能助手"},
6767
{
@@ -87,7 +87,7 @@ async def main() -> None:
8787
# ==========================================================
8888
print("\nTurn 2: follow-up referencing prior turn's response")
8989
stream = await client.responses.create(
90-
model="doubao-seed-1-6",
90+
model="doubao-seed-2-1-pro-260628",
9191
previous_response_id=response_id,
9292
input=[
9393
{"role": "user", "content": "上一轮对话里视频里的内容是"},

0 commit comments

Comments
 (0)