Skip to content

Commit a675288

Browse files
Wang Zesongdayflyshao
authored andcommitted
feat: seperate classes
fix: seperate classes fix: reimport
1 parent cef8afa commit a675288

11 files changed

+205
-109
lines changed
Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright (c) [2025] [OpenAI]
32
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
43
# SPDX-License-Identifier: Apache-2.0
@@ -10,27 +9,9 @@
109
#
1110
# This modified file is released under the same license.
1211

13-
from typing_extensions import Literal
1412

15-
from ..._models import BaseModel
16-
from .response_output_text import ResponseOutputTextAnnotation
13+
from .response_output_text_annotation_added_event import (
14+
ResponseOutputTextAnnotationAddedEvent,
15+
)
1716

1817
__all__ = ["ResponseOutputTextAnnotationAddedEvent"]
19-
20-
21-
class ResponseOutputTextAnnotationAddedEvent(BaseModel):
22-
23-
item_id: str
24-
"""The ID of the item this event is associated with."""
25-
26-
output_index: int
27-
"""The index of the output item this event is associated with."""
28-
29-
type: Literal["response.output_text.annotation.added"]
30-
"""The type of the event. Always `response.annotation.added`."""
31-
32-
content_index: int
33-
"""The index of the content in the output content."""
34-
35-
annotation: ResponseOutputTextAnnotation
36-
"""The annotation added to the output content."""

volcenginesdkarkruntime/types/responses/response_caching.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright (c) [2025] [OpenAI]
32
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
43
# SPDX-License-Identifier: Apache-2.0
@@ -13,7 +12,7 @@
1312
from typing import Optional
1413
from typing_extensions import Literal
1514

16-
from pydantic import BaseModel
15+
from ..._models import BaseModel
1716

1817
__all__ = ["ResponseCaching"]
1918

@@ -22,4 +21,4 @@ class ResponseCaching(BaseModel):
2221
type: Optional[Literal["enabled", "disabled"]]
2322
"""
2423
Whether to enable caching.
25-
"""
24+
"""

volcenginesdkarkruntime/types/responses/response_output_text.py

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright (c) [2025] [OpenAI]
32
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
43
# SPDX-License-Identifier: Apache-2.0
@@ -14,39 +13,11 @@
1413

1514
from ..._models import BaseModel
1615

17-
__all__ = ["ResponseOutputText", "ResponseOutputTextAnnotation"]
18-
16+
from .response_output_text_annotation import (
17+
ResponseOutputTextAnnotation,
18+
)
1919

20-
class ResponsesOutputTextAnnotationCoverImage(BaseModel):
21-
url: Optional[str] = None
22-
"""The url of the cover image."""
23-
width: Optional[int] = None
24-
"""The width of the cover image."""
25-
height: Optional[int] = None
26-
"""The height of the cover image."""
27-
28-
29-
class ResponseOutputTextAnnotation(BaseModel):
30-
type: Literal["annotation"]
31-
"""The type of the url_citation. Always `url_citation`."""
32-
title: Optional[str] = None
33-
"""The title of the url_citation."""
34-
url: Optional[str] = None
35-
"""The url of the url_citation."""
36-
logo_url: Optional[str] = None
37-
"""The logo_url of the url_citation."""
38-
mobile_url: Optional[str] = None
39-
"""The mobile_url of the url_citation."""
40-
site_name: Optional[str] = None
41-
"""The site_name of the url_citation."""
42-
publish_time: Optional[str] = None
43-
"""The publish_time of the url_citation."""
44-
summary: Optional[str] = None
45-
"""The summary of the url_citation."""
46-
freshness_info: Optional[str] = None
47-
"""The freshness_info of the url_citation."""
48-
cover_image: Optional[ResponsesOutputTextAnnotationCoverImage] = None
49-
"""The cover_image of the url_citation."""
20+
__all__ = ["ResponseOutputText", "ResponseOutputTextAnnotation"]
5021

5122

5223
class ResponseOutputText(BaseModel):
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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_extensions import Literal, Optional
13+
14+
from ..._models import BaseModel
15+
16+
from .responses_output_text_annotation_cover_image import (
17+
ResponsesOutputTextAnnotationCoverImage,
18+
)
19+
20+
__all__ = ["ResponseOutputTextAnnotation"]
21+
22+
23+
class ResponseOutputTextAnnotation(BaseModel):
24+
type: Literal["annotation"]
25+
"""The type of the url_citation. Always `url_citation`."""
26+
title: Optional[str] = None
27+
"""The title of the url_citation."""
28+
url: Optional[str] = None
29+
"""The url of the url_citation."""
30+
logo_url: Optional[str] = None
31+
"""The logo_url of the url_citation."""
32+
mobile_url: Optional[str] = None
33+
"""The mobile_url of the url_citation."""
34+
site_name: Optional[str] = None
35+
"""The site_name of the url_citation."""
36+
publish_time: Optional[str] = None
37+
"""The publish_time of the url_citation."""
38+
summary: Optional[str] = None
39+
"""The summary of the url_citation."""
40+
freshness_info: Optional[str] = None
41+
"""The freshness_info of the url_citation."""
42+
cover_image: Optional[ResponsesOutputTextAnnotationCoverImage] = None
43+
"""The cover_image of the url_citation."""
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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_extensions import Literal
13+
14+
from ..._models import BaseModel
15+
from .response_output_text import ResponseOutputTextAnnotation
16+
17+
18+
class ResponseOutputTextAnnotationAddedEvent(BaseModel):
19+
20+
item_id: str
21+
"""The ID of the item this event is associated with."""
22+
23+
output_index: int
24+
"""The index of the output item this event is associated with."""
25+
26+
type: Literal["response.output_text.annotation.added"]
27+
"""The type of the event. Always `response.annotation.added`."""
28+
29+
content_index: int
30+
"""The index of the content in the output content."""
31+
32+
annotation: ResponseOutputTextAnnotation
33+
"""The annotation added to the output content."""

volcenginesdkarkruntime/types/responses/response_stream_event.py

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright (c) [2025] [OpenAI]
32
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
43
# SPDX-License-Identifier: Apache-2.0
@@ -26,26 +25,45 @@
2625
from .response_content_part_done_event import ResponseContentPartDoneEvent
2726
from .response_output_item_added_event import ResponseOutputItemAddedEvent
2827
from .response_content_part_added_event import ResponseContentPartAddedEvent
29-
from .response_reasoning_summary_part_done_event import ResponseReasoningSummaryPartDoneEvent
30-
from .response_reasoning_summary_text_done_event import ResponseReasoningSummaryTextDoneEvent
31-
from .response_function_call_arguments_done_event import ResponseFunctionCallArgumentsDoneEvent
32-
from .response_reasoning_summary_part_added_event import ResponseReasoningSummaryPartAddedEvent
33-
from .response_reasoning_summary_text_delta_event import ResponseReasoningSummaryTextDeltaEvent
34-
from .response_function_call_arguments_delta_event import ResponseFunctionCallArgumentsDeltaEvent
35-
from .response_web_search_call_in_progress_event import ResponseWebSearchCallInProgressEvent
36-
from .response_web_search_call_searching_event import ResponseWebSearchCallSearchingEvent
37-
from .response_web_search_call_completed_event import ResponseWebSearchCallCompletedEvent
28+
from .response_reasoning_summary_part_done_event import (
29+
ResponseReasoningSummaryPartDoneEvent,
30+
)
31+
from .response_reasoning_summary_text_done_event import (
32+
ResponseReasoningSummaryTextDoneEvent,
33+
)
34+
from .response_function_call_arguments_done_event import (
35+
ResponseFunctionCallArgumentsDoneEvent,
36+
)
37+
from .response_reasoning_summary_part_added_event import (
38+
ResponseReasoningSummaryPartAddedEvent,
39+
)
40+
from .response_reasoning_summary_text_delta_event import (
41+
ResponseReasoningSummaryTextDeltaEvent,
42+
)
43+
from .response_function_call_arguments_delta_event import (
44+
ResponseFunctionCallArgumentsDeltaEvent,
45+
)
46+
from .response_web_search_call_in_progress_event import (
47+
ResponseWebSearchCallInProgressEvent,
48+
)
49+
from .response_web_search_call_searching_event import (
50+
ResponseWebSearchCallSearchingEvent,
51+
)
52+
from .response_web_search_call_completed_event import (
53+
ResponseWebSearchCallCompletedEvent,
54+
)
3855
from .response_annotation_added_event import ResponseOutputTextAnnotationAddedEvent
3956
from .response_mcp_call_failed_event import ResponseMcpCallFailedEvent
4057
from .response_mcp_call_in_progress_event import ResponseMcpCallInProgressEvent
4158
from .response_mcp_call_completed_event import ResponseMcpCallCompletedEvent
4259
from .response_mcp_call_arguments_done_event import ResponseMcpCallArgumentsDoneEvent
4360
from .response_mcp_call_arguments_delta_event import ResponseMcpCallArgumentsDeltaEvent
4461
from .response_mcp_list_tools_failed_event import ResponseMcpListToolsFailedEvent
45-
from .response_mcp_list_tools_in_progress_event import ResponseMcpListToolsInProgressEvent
62+
from .response_mcp_list_tools_in_progress_event import (
63+
ResponseMcpListToolsInProgressEvent,
64+
)
4665
from .response_mcp_list_tools_completed_event import ResponseMcpListToolsCompletedEvent
4766

48-
4967
__all__ = ["ResponseStreamEvent"]
5068

5169
ResponseStreamEvent: TypeAlias = Annotated[
@@ -55,31 +73,23 @@
5573
ResponseCompletedEvent,
5674
ResponseFailedEvent,
5775
ResponseIncompleteEvent,
58-
5976
ResponseOutputItemAddedEvent,
6077
ResponseOutputItemDoneEvent,
61-
6278
ResponseContentPartAddedEvent,
6379
ResponseContentPartDoneEvent,
64-
6580
ResponseTextDeltaEvent,
6681
ResponseTextDoneEvent,
67-
6882
ResponseReasoningSummaryPartAddedEvent,
6983
ResponseReasoningSummaryPartDoneEvent,
7084
ResponseReasoningSummaryTextDeltaEvent,
7185
ResponseReasoningSummaryTextDoneEvent,
72-
7386
ResponseFunctionCallArgumentsDeltaEvent,
7487
ResponseFunctionCallArgumentsDoneEvent,
75-
7688
ResponseErrorEvent,
77-
7889
ResponseWebSearchCallInProgressEvent,
7990
ResponseWebSearchCallSearchingEvent,
8091
ResponseWebSearchCallCompletedEvent,
8192
ResponseOutputTextAnnotationAddedEvent,
82-
8393
ResponseMcpCallFailedEvent,
8494
ResponseMcpCallInProgressEvent,
8595
ResponseMcpCallCompletedEvent,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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_extensions import Optional
13+
14+
from ..._models import BaseModel
15+
16+
__all__ = ["ResponsesOutputTextAnnotationCoverImage"]
17+
18+
19+
class ResponsesOutputTextAnnotationCoverImage(BaseModel):
20+
url: Optional[str] = None
21+
"""The url of the cover image."""
22+
width: Optional[int] = None
23+
"""The width of the cover image."""
24+
height: Optional[int] = None
25+
"""The height of the cover image."""
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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_extensions import Literal, Optional
13+
14+
from ..._models import BaseModel
15+
16+
__all__ = ["UserLocation"]
17+
18+
19+
class UserLocation(BaseModel):
20+
type: Literal["approximate"]
21+
"""The type of the user location. Always `approximate`."""
22+
city: Optional[str]
23+
"""The city of the user location."""
24+
country: Optional[str]
25+
"""The country of the user location."""
26+
region: Optional[str]
27+
"""The region of the user location."""
28+
timezone: Optional[float]
29+
"""The timezone of the user location."""
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 __future__ import annotations
13+
14+
from typing import Optional
15+
from typing_extensions import Literal, Required, TypedDict
16+
17+
18+
__all__ = ["UserLocationParam"]
19+
20+
21+
class UserLocationParam(TypedDict, total=False):
22+
type: Required[Literal["approximate"]]
23+
"""The type of the user location. Always `approximate`."""
24+
city: Optional[str]
25+
"""The city of the user location."""
26+
country: Optional[str]
27+
"""The country of the user location."""
28+
region: Optional[str]
29+
"""The region of the user location."""
30+
timezone: Optional[float]
31+
"""The timezone of the user location."""

0 commit comments

Comments
 (0)