Skip to content

Commit 482a0ac

Browse files
author
BitsAdmin
committed
Merge 'feat/support-audio-1-5-pro' into 'integration_2025-12-25_1097365330690'
feat: [development task] ark runtime (1971895) See merge request: !986
2 parents 60fec57 + 4e15f19 commit 482a0ac

File tree

47 files changed

+1254
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1254
-106
lines changed

volcenginesdkarkruntime/_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ def _extract_field_schema_pv2(
654654
model: type[BaseModel], field_name: str
655655
) -> ModelField | None:
656656
schema = model.__pydantic_core_schema__
657+
if schema["type"] == "definitions":
658+
schema = schema["schema"]
657659
if schema["type"] != "model":
658660
return None
659661

volcenginesdkarkruntime/resources/content_generation/tasks.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def create(
4848
return_last_frame: Optional[bool] = None,
4949
service_tier: Optional[str] = None,
5050
execution_expires_after: Optional[int] = None,
51+
generate_audio: Optional[bool] = None,
5152
extra_headers: Headers | None = None,
5253
extra_query: Query | None = None,
5354
extra_body: Body | None = None,
@@ -62,6 +63,7 @@ def create(
6263
"return_last_frame": return_last_frame,
6364
"service_tier": service_tier,
6465
"execution_expires_after": execution_expires_after,
66+
"generate_audio": generate_audio,
6567
},
6668
options=make_request_options(
6769
extra_headers=extra_headers,
@@ -176,6 +178,7 @@ async def create(
176178
return_last_frame: Optional[bool] = None,
177179
service_tier: Optional[str] = None,
178180
execution_expires_after: Optional[int] = None,
181+
generate_audio: Optional[bool] = None,
179182
extra_headers: Headers | None = None,
180183
extra_query: Query | None = None,
181184
extra_body: Body | None = None,
@@ -190,6 +193,7 @@ async def create(
190193
"return_last_frame": return_last_frame,
191194
"service_tier": service_tier,
192195
"execution_expires_after": execution_expires_after,
196+
"generate_audio": generate_audio,
193197
},
194198
options=make_request_options(
195199
extra_headers=extra_headers,

volcenginesdkarkruntime/resources/responses/responses.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ def _add_beta_headers(
7575
if extra_headers is None:
7676
extra_headers = {}
7777
extra_headers["ark-beta-mcp"] = "true"
78+
if tool_param.get("type", "") == "knowledge_search":
79+
if extra_headers is None:
80+
extra_headers = {}
81+
extra_headers["ark-beta-knowledge-search"] = "true"
82+
if tool_param.get("type", "") == "doubao_app":
83+
if extra_headers is None:
84+
extra_headers = {}
85+
extra_headers["ark-beta-doubao-app"] = "true"
86+
if tool_param.get("type", "") == "image_process":
87+
if extra_headers is None:
88+
extra_headers = {}
89+
extra_headers["ark-beta-image-process"] = "true"
7890
return extra_headers
7991

8092

volcenginesdkarkruntime/types/content_generation/content_generation_task.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ class ContentGenerationTask(BaseModel):
8686

8787
execution_expires_after: int
8888
"""The expiration time in seconds after which execution should end (optional)."""
89+
90+
generate_audio: bool
91+
"""Whether to generate audio."""
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) [2025] [OpenAI]
2+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
6+
#
7+
# Original file was released under Apache License Version 2.0, with the full license text
8+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
9+
#
10+
# This modified file is released under the same license.
11+
12+
from typing import Union
13+
14+
from typing_extensions import Annotated, TypeAlias
15+
16+
from ..._utils import PropertyInfo
17+
from .response_output_text import ResponseOutputText
18+
19+
__all__ = ["Content"]
20+
21+
Content: TypeAlias = Annotated[
22+
Union[ResponseOutputText],
23+
PropertyInfo(discriminator="type"),
24+
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) [2025] [OpenAI]
2+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
6+
#
7+
# Original file was released under Apache License Version 2.0, with the full license text
8+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
9+
#
10+
# This modified file is released under the same license.
11+
12+
from typing import Union
13+
14+
from typing_extensions import Annotated, TypeAlias
15+
16+
from ..._utils import PropertyInfo
17+
from .doubao_app_call_block_output_text import DoubaoAppCallBlockOutputText
18+
from .doubao_app_call_block_reasoning_search import DoubaoAppCallBlockReasoningSearch
19+
from .doubao_app_call_block_reasoning_text import DoubaoAppCallBlockReasoningText
20+
from .doubao_app_call_block_search import DoubaoAppCallBlockSearch
21+
22+
__all__ = ["DoubaoAppCallBlock"]
23+
24+
DoubaoAppCallBlock: TypeAlias = Annotated[
25+
Union[
26+
DoubaoAppCallBlockOutputText,
27+
DoubaoAppCallBlockReasoningText,
28+
DoubaoAppCallBlockSearch,
29+
DoubaoAppCallBlockReasoningSearch,
30+
],
31+
PropertyInfo(discriminator="type"),
32+
]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) [2025] [OpenAI]
2+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
6+
#
7+
# Original file was released under Apache License Version 2.0, with the full license text
8+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
9+
#
10+
# This modified file is released under the same license.
11+
12+
from typing import Optional
13+
14+
from typing_extensions import Literal
15+
16+
from ..._models import BaseModel
17+
18+
__all__ = ["DoubaoAppCallBlockOutputText"]
19+
20+
21+
class DoubaoAppCallBlockOutputText(BaseModel):
22+
id: Optional[str] = None
23+
24+
type: Literal["output_text"]
25+
26+
text: str
27+
28+
status: Literal["in_progress", "completed", "incomplete", "searching", "failed"]
29+
30+
parent_id: Optional[str] = None
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) [2025] [OpenAI]
2+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
6+
#
7+
# Original file was released under Apache License Version 2.0, with the full license text
8+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
9+
#
10+
# This modified file is released under the same license.
11+
12+
from typing import List, Optional
13+
14+
from typing_extensions import Literal
15+
16+
from ..._models import BaseModel
17+
from .doubao_app_search_result import DoubaoAppSearchResult
18+
19+
__all__ = ["DoubaoAppCallBlockReasoningSearch"]
20+
21+
22+
class DoubaoAppCallBlockReasoningSearch(BaseModel):
23+
id: Optional[str] = None
24+
25+
type: Literal["reasoning_search"]
26+
27+
summary: Optional[str] = None
28+
29+
queries: List[str]
30+
31+
results: List[DoubaoAppSearchResult]
32+
33+
status: Literal["in_progress", "completed", "incomplete", "searching", "failed"]
34+
35+
parent_id: Optional[str] = None
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) [2025] [OpenAI]
2+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
6+
#
7+
# Original file was released under Apache License Version 2.0, with the full license text
8+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
9+
#
10+
# This modified file is released under the same license.
11+
12+
from typing import Optional
13+
14+
from typing_extensions import Literal
15+
16+
from ..._models import BaseModel
17+
18+
__all__ = ["DoubaoAppCallBlockReasoningText"]
19+
20+
21+
class DoubaoAppCallBlockReasoningText(BaseModel):
22+
id: Optional[str] = None
23+
24+
type: Literal["reasoning_text"]
25+
26+
reasoning_text: str
27+
28+
status: Literal["in_progress", "completed", "incomplete", "searching", "failed"]
29+
30+
parent_id: Optional[str] = None
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) [2025] [OpenAI]
2+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
6+
#
7+
# Original file was released under Apache License Version 2.0, with the full license text
8+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
9+
#
10+
# This modified file is released under the same license.
11+
12+
from typing import List, Optional
13+
14+
from typing_extensions import Literal
15+
16+
from ..._models import BaseModel
17+
from .doubao_app_search_result import DoubaoAppSearchResult
18+
19+
__all__ = ["DoubaoAppCallBlockSearch"]
20+
21+
22+
class DoubaoAppCallBlockSearch(BaseModel):
23+
id: Optional[str] = None
24+
25+
type: Literal["search"]
26+
27+
summary: Optional[str] = None
28+
29+
queries: List[str]
30+
31+
results: List[DoubaoAppSearchResult]
32+
33+
status: Literal["in_progress", "completed", "incomplete", "searching", "failed"]
34+
35+
parent_id: Optional[str] = None

0 commit comments

Comments
 (0)