Skip to content

Commit 4e15f19

Browse files
Merge 'feat/doubao_gen_v2' into 'feat/support-audio-1-5-pro'
feat: gen v2 See merge request: !939
2 parents 0e5eee2 + 7bc8c11 commit 4e15f19

File tree

45 files changed

+1247
-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.

45 files changed

+1247
-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/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

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
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
15+
from ..._models import BaseModel
16+
from .doubao_app_feature_item import DoubaoAppFeatureItem
17+
18+
__all__ = ["DoubaoAppFeature"]
19+
20+
21+
class DoubaoAppFeature(BaseModel):
22+
chat: Optional[DoubaoAppFeatureItem] = None
23+
24+
deep_chat: Optional[DoubaoAppFeatureItem] = None
25+
26+
ai_search: Optional[DoubaoAppFeatureItem] = None
27+
28+
reasoning_search: Optional[DoubaoAppFeatureItem] = None
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 Optional
13+
14+
from typing_extensions import Literal
15+
16+
from ..._models import BaseModel
17+
18+
__all__ = ["DoubaoAppFeatureItem"]
19+
20+
21+
class DoubaoAppFeatureItem(BaseModel):
22+
type: Optional[Literal["enabled", "disabled"]] = None
23+
24+
role_description: Optional[str] = None

0 commit comments

Comments
 (0)