byteplussdk-arkruntime 3.0.64__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- byteplussdk_arkruntime-3.0.64.dist-info/METADATA +36 -0
- byteplussdk_arkruntime-3.0.64.dist-info/RECORD +240 -0
- byteplussdk_arkruntime-3.0.64.dist-info/WHEEL +5 -0
- byteplussdk_arkruntime-3.0.64.dist-info/licenses/LICENSE.txt +203 -0
- byteplussdk_arkruntime-3.0.64.dist-info/top_level.txt +1 -0
- byteplussdkarkruntime/__init__.py +7 -0
- byteplussdkarkruntime/_base_client.py +1439 -0
- byteplussdkarkruntime/_client.py +570 -0
- byteplussdkarkruntime/_compat.py +245 -0
- byteplussdkarkruntime/_constants.py +43 -0
- byteplussdkarkruntime/_exceptions.py +202 -0
- byteplussdkarkruntime/_files.py +149 -0
- byteplussdkarkruntime/_legacy_response.py +451 -0
- byteplussdkarkruntime/_models.py +734 -0
- byteplussdkarkruntime/_qs.py +168 -0
- byteplussdkarkruntime/_request_options.py +117 -0
- byteplussdkarkruntime/_resource.py +47 -0
- byteplussdkarkruntime/_response.py +615 -0
- byteplussdkarkruntime/_streaming.py +470 -0
- byteplussdkarkruntime/_types.py +210 -0
- byteplussdkarkruntime/_utils/__init__.py +58 -0
- byteplussdkarkruntime/_utils/_key_agreement.py +207 -0
- byteplussdkarkruntime/_utils/_logs.py +24 -0
- byteplussdkarkruntime/_utils/_model_breaker.py +83 -0
- byteplussdkarkruntime/_utils/_streams.py +12 -0
- byteplussdkarkruntime/_utils/_transform.py +489 -0
- byteplussdkarkruntime/_utils/_typing.py +171 -0
- byteplussdkarkruntime/_utils/_utils.py +497 -0
- byteplussdkarkruntime/common/__init__.py +14 -0
- byteplussdkarkruntime/common/_parsing/__init__.py +22 -0
- byteplussdkarkruntime/common/_parsing/_completions.py +290 -0
- byteplussdkarkruntime/common/_parsing/_responses.py +189 -0
- byteplussdkarkruntime/common/_pydantic.py +192 -0
- byteplussdkarkruntime/common/_tools.py +67 -0
- byteplussdkarkruntime/common/streaming/__init__.py +12 -0
- byteplussdkarkruntime/common/streaming/_deltas.py +86 -0
- byteplussdkarkruntime/common/streaming/chat/__init__.py +33 -0
- byteplussdkarkruntime/common/streaming/chat/_completions.py +772 -0
- byteplussdkarkruntime/common/streaming/chat/_events.py +103 -0
- byteplussdkarkruntime/common/streaming/chat/_types.py +36 -0
- byteplussdkarkruntime/pagination.py +134 -0
- byteplussdkarkruntime/resources/__init__.py +48 -0
- byteplussdkarkruntime/resources/batch/__init__.py +3 -0
- byteplussdkarkruntime/resources/batch/_utils.py +155 -0
- byteplussdkarkruntime/resources/batch/batch.py +37 -0
- byteplussdkarkruntime/resources/batch/chat/__init__.py +3 -0
- byteplussdkarkruntime/resources/batch/chat/chat.py +19 -0
- byteplussdkarkruntime/resources/batch/chat/completions.py +329 -0
- byteplussdkarkruntime/resources/batch/embeddings.py +105 -0
- byteplussdkarkruntime/resources/batch/multimodal_embeddings.py +111 -0
- byteplussdkarkruntime/resources/batch_chat/__init__.py +3 -0
- byteplussdkarkruntime/resources/batch_chat/chat.py +21 -0
- byteplussdkarkruntime/resources/batch_chat/completions.py +328 -0
- byteplussdkarkruntime/resources/beta/__init__.py +12 -0
- byteplussdkarkruntime/resources/beta/beta.py +81 -0
- byteplussdkarkruntime/resources/beta/chat/__init__.py +21 -0
- byteplussdkarkruntime/resources/beta/chat/chat.py +31 -0
- byteplussdkarkruntime/resources/beta/chat/completions.py +454 -0
- byteplussdkarkruntime/resources/chat/__init__.py +3 -0
- byteplussdkarkruntime/resources/chat/chat.py +21 -0
- byteplussdkarkruntime/resources/chat/completions.py +258 -0
- byteplussdkarkruntime/resources/content_generation/__init__.py +6 -0
- byteplussdkarkruntime/resources/content_generation/content_generation.py +17 -0
- byteplussdkarkruntime/resources/content_generation/tasks.py +348 -0
- byteplussdkarkruntime/resources/context/__init__.py +3 -0
- byteplussdkarkruntime/resources/context/completions.py +221 -0
- byteplussdkarkruntime/resources/context/context.py +98 -0
- byteplussdkarkruntime/resources/embeddings.py +110 -0
- byteplussdkarkruntime/resources/encryption.py +215 -0
- byteplussdkarkruntime/resources/files.py +592 -0
- byteplussdkarkruntime/resources/images/__init__.py +6 -0
- byteplussdkarkruntime/resources/images/images.py +335 -0
- byteplussdkarkruntime/resources/multimodal_embeddings.py +113 -0
- byteplussdkarkruntime/resources/responses/__init__.py +16 -0
- byteplussdkarkruntime/resources/responses/input_items.py +248 -0
- byteplussdkarkruntime/resources/responses/responses.py +417 -0
- byteplussdkarkruntime/types/__init__.py +28 -0
- byteplussdkarkruntime/types/chat/__init__.py +78 -0
- byteplussdkarkruntime/types/chat/chat_completion.py +93 -0
- byteplussdkarkruntime/types/chat/chat_completion_assistant_message_param.py +61 -0
- byteplussdkarkruntime/types/chat/chat_completion_audio.py +22 -0
- byteplussdkarkruntime/types/chat/chat_completion_chunk.py +165 -0
- byteplussdkarkruntime/types/chat/chat_completion_content_part_image_param.py +20 -0
- byteplussdkarkruntime/types/chat/chat_completion_content_part_param.py +30 -0
- byteplussdkarkruntime/types/chat/chat_completion_content_part_text_param.py +13 -0
- byteplussdkarkruntime/types/chat/chat_completion_content_part_video_param.py +32 -0
- byteplussdkarkruntime/types/chat/chat_completion_function_call_option_param.py +10 -0
- byteplussdkarkruntime/types/chat/chat_completion_function_message_param.py +17 -0
- byteplussdkarkruntime/types/chat/chat_completion_message.py +56 -0
- byteplussdkarkruntime/types/chat/chat_completion_message_param.py +19 -0
- byteplussdkarkruntime/types/chat/chat_completion_message_tool_call.py +29 -0
- byteplussdkarkruntime/types/chat/chat_completion_message_tool_call_param.py +29 -0
- byteplussdkarkruntime/types/chat/chat_completion_named_tool_choice_param.py +17 -0
- byteplussdkarkruntime/types/chat/chat_completion_role.py +5 -0
- byteplussdkarkruntime/types/chat/chat_completion_stream_options_param.py +19 -0
- byteplussdkarkruntime/types/chat/chat_completion_system_message_param.py +34 -0
- byteplussdkarkruntime/types/chat/chat_completion_token_logprob.py +55 -0
- byteplussdkarkruntime/types/chat/chat_completion_tool_choice_option_param.py +12 -0
- byteplussdkarkruntime/types/chat/chat_completion_tool_message_param.py +37 -0
- byteplussdkarkruntime/types/chat/chat_completion_tool_param.py +14 -0
- byteplussdkarkruntime/types/chat/chat_completion_user_message_param.py +34 -0
- byteplussdkarkruntime/types/chat/completion_create_params.py +258 -0
- byteplussdkarkruntime/types/chat/parsed_chat_completion.py +52 -0
- byteplussdkarkruntime/types/chat/parsed_function_tool_call.py +34 -0
- byteplussdkarkruntime/types/completion_usage.py +33 -0
- byteplussdkarkruntime/types/content_generation/__init__.py +0 -0
- byteplussdkarkruntime/types/content_generation/content_generation_task.py +106 -0
- byteplussdkarkruntime/types/content_generation/content_generation_task_id.py +11 -0
- byteplussdkarkruntime/types/content_generation/create_task_content_param.py +72 -0
- byteplussdkarkruntime/types/content_generation/list_content_generation_tasks_response.py +24 -0
- byteplussdkarkruntime/types/context/__init__.py +8 -0
- byteplussdkarkruntime/types/context/context_chat_completion.py +33 -0
- byteplussdkarkruntime/types/context/context_chat_completion_chunk.py +41 -0
- byteplussdkarkruntime/types/context/context_create_params.py +37 -0
- byteplussdkarkruntime/types/context/create_context_response.py +25 -0
- byteplussdkarkruntime/types/context/truncation_strategy.py +13 -0
- byteplussdkarkruntime/types/create_embedding_response.py +36 -0
- byteplussdkarkruntime/types/embedding.py +21 -0
- byteplussdkarkruntime/types/file_create_params.py +49 -0
- byteplussdkarkruntime/types/file_deleted.py +24 -0
- byteplussdkarkruntime/types/file_list_params.py +43 -0
- byteplussdkarkruntime/types/file_object.py +69 -0
- byteplussdkarkruntime/types/file_purpose.py +16 -0
- byteplussdkarkruntime/types/images/__init__.py +3 -0
- byteplussdkarkruntime/types/images/image_gen_completed_event.py +59 -0
- byteplussdkarkruntime/types/images/image_gen_generating_event.py +53 -0
- byteplussdkarkruntime/types/images/image_gen_stream_event.py +24 -0
- byteplussdkarkruntime/types/images/images.py +99 -0
- byteplussdkarkruntime/types/multimodal_embedding/__init__.py +15 -0
- byteplussdkarkruntime/types/multimodal_embedding/embedding_content_part_image_param.py +17 -0
- byteplussdkarkruntime/types/multimodal_embedding/embedding_content_part_text_param.py +13 -0
- byteplussdkarkruntime/types/multimodal_embedding/embedding_data.py +15 -0
- byteplussdkarkruntime/types/multimodal_embedding/embedding_input.py +12 -0
- byteplussdkarkruntime/types/multimodal_embedding/embedding_response.py +29 -0
- byteplussdkarkruntime/types/multimodal_embedding/embedding_usage.py +23 -0
- byteplussdkarkruntime/types/responses/__init__.py +133 -0
- byteplussdkarkruntime/types/responses/easy_input_message.py +36 -0
- byteplussdkarkruntime/types/responses/easy_input_message_param.py +37 -0
- byteplussdkarkruntime/types/responses/function_tool.py +35 -0
- byteplussdkarkruntime/types/responses/function_tool_param.py +35 -0
- byteplussdkarkruntime/types/responses/input_item_list_params.py +47 -0
- byteplussdkarkruntime/types/responses/mcp_input_item_param.py +109 -0
- byteplussdkarkruntime/types/responses/mcp_tool.py +80 -0
- byteplussdkarkruntime/types/responses/mcp_tool_param.py +78 -0
- byteplussdkarkruntime/types/responses/response.py +152 -0
- byteplussdkarkruntime/types/responses/response_annotation_added_event.py +36 -0
- byteplussdkarkruntime/types/responses/response_caching.py +25 -0
- byteplussdkarkruntime/types/responses/response_caching_param.py +22 -0
- byteplussdkarkruntime/types/responses/response_completed_event.py +26 -0
- byteplussdkarkruntime/types/responses/response_content_part_added_event.py +39 -0
- byteplussdkarkruntime/types/responses/response_content_part_done_event.py +39 -0
- byteplussdkarkruntime/types/responses/response_create_params.py +26 -0
- byteplussdkarkruntime/types/responses/response_created_event.py +26 -0
- byteplussdkarkruntime/types/responses/response_error.py +25 -0
- byteplussdkarkruntime/types/responses/response_error_event.py +32 -0
- byteplussdkarkruntime/types/responses/response_failed_event.py +26 -0
- byteplussdkarkruntime/types/responses/response_format_text_config.py +25 -0
- byteplussdkarkruntime/types/responses/response_format_text_config_param.py +25 -0
- byteplussdkarkruntime/types/responses/response_function_call_arguments_delta_event.py +33 -0
- byteplussdkarkruntime/types/responses/response_function_call_arguments_done_event.py +30 -0
- byteplussdkarkruntime/types/responses/response_function_tool_call.py +42 -0
- byteplussdkarkruntime/types/responses/response_function_tool_call_item.py +20 -0
- byteplussdkarkruntime/types/responses/response_function_tool_call_output_item.py +39 -0
- byteplussdkarkruntime/types/responses/response_function_tool_call_param.py +31 -0
- byteplussdkarkruntime/types/responses/response_in_progress_event.py +26 -0
- byteplussdkarkruntime/types/responses/response_includable.py +19 -0
- byteplussdkarkruntime/types/responses/response_incomplete_details.py +30 -0
- byteplussdkarkruntime/types/responses/response_incomplete_event.py +26 -0
- byteplussdkarkruntime/types/responses/response_input_content.py +24 -0
- byteplussdkarkruntime/types/responses/response_input_content_param.py +23 -0
- byteplussdkarkruntime/types/responses/response_input_image.py +38 -0
- byteplussdkarkruntime/types/responses/response_input_image_param.py +42 -0
- byteplussdkarkruntime/types/responses/response_input_image_pixel_limit_param.py +29 -0
- byteplussdkarkruntime/types/responses/response_input_message_content_list.py +20 -0
- byteplussdkarkruntime/types/responses/response_input_message_content_list_param.py +26 -0
- byteplussdkarkruntime/types/responses/response_input_message_item.py +43 -0
- byteplussdkarkruntime/types/responses/response_input_param.py +51 -0
- byteplussdkarkruntime/types/responses/response_input_text.py +25 -0
- byteplussdkarkruntime/types/responses/response_input_text_param.py +25 -0
- byteplussdkarkruntime/types/responses/response_input_video_param.py +34 -0
- byteplussdkarkruntime/types/responses/response_item.py +40 -0
- byteplussdkarkruntime/types/responses/response_item_list.py +36 -0
- byteplussdkarkruntime/types/responses/response_mcp_call_arguments_delta_event.py +37 -0
- byteplussdkarkruntime/types/responses/response_mcp_call_arguments_done_event.py +34 -0
- byteplussdkarkruntime/types/responses/response_mcp_call_completed_event.py +31 -0
- byteplussdkarkruntime/types/responses/response_mcp_call_failed_event.py +31 -0
- byteplussdkarkruntime/types/responses/response_mcp_call_in_progress_event.py +31 -0
- byteplussdkarkruntime/types/responses/response_mcp_item.py +110 -0
- byteplussdkarkruntime/types/responses/response_mcp_list_tools_completed_event.py +31 -0
- byteplussdkarkruntime/types/responses/response_mcp_list_tools_failed_event.py +31 -0
- byteplussdkarkruntime/types/responses/response_mcp_list_tools_in_progress_event.py +31 -0
- byteplussdkarkruntime/types/responses/response_output_item.py +36 -0
- byteplussdkarkruntime/types/responses/response_output_item_added_event.py +29 -0
- byteplussdkarkruntime/types/responses/response_output_item_done_event.py +29 -0
- byteplussdkarkruntime/types/responses/response_output_message.py +43 -0
- byteplussdkarkruntime/types/responses/response_output_text.py +61 -0
- byteplussdkarkruntime/types/responses/response_output_text_param.py +77 -0
- byteplussdkarkruntime/types/responses/response_reasoning_item.py +46 -0
- byteplussdkarkruntime/types/responses/response_reasoning_item_param.py +37 -0
- byteplussdkarkruntime/types/responses/response_reasoning_summary_part_added_event.py +42 -0
- byteplussdkarkruntime/types/responses/response_reasoning_summary_part_done_event.py +42 -0
- byteplussdkarkruntime/types/responses/response_reasoning_summary_text_delta_event.py +34 -0
- byteplussdkarkruntime/types/responses/response_reasoning_summary_text_done_event.py +34 -0
- byteplussdkarkruntime/types/responses/response_status.py +17 -0
- byteplussdkarkruntime/types/responses/response_stream_event.py +93 -0
- byteplussdkarkruntime/types/responses/response_text_config.py +28 -0
- byteplussdkarkruntime/types/responses/response_text_config_param.py +31 -0
- byteplussdkarkruntime/types/responses/response_text_delta_event.py +34 -0
- byteplussdkarkruntime/types/responses/response_text_done_event.py +34 -0
- byteplussdkarkruntime/types/responses/response_tool_usage.py +32 -0
- byteplussdkarkruntime/types/responses/response_usage.py +54 -0
- byteplussdkarkruntime/types/responses/response_web_search_call_completed_event.py +29 -0
- byteplussdkarkruntime/types/responses/response_web_search_call_in_progress_event.py +29 -0
- byteplussdkarkruntime/types/responses/response_web_search_call_searching_event.py +29 -0
- byteplussdkarkruntime/types/responses/response_web_search_item.py +43 -0
- byteplussdkarkruntime/types/responses/tool.py +25 -0
- byteplussdkarkruntime/types/responses/tool_choice_function.py +25 -0
- byteplussdkarkruntime/types/responses/tool_choice_function_param.py +25 -0
- byteplussdkarkruntime/types/responses/tool_choice_mcp_param.py +29 -0
- byteplussdkarkruntime/types/responses/tool_choice_options.py +17 -0
- byteplussdkarkruntime/types/responses/tool_param.py +24 -0
- byteplussdkarkruntime/types/responses/web_search_tool.py +49 -0
- byteplussdkarkruntime/types/responses/web_search_tool_param.py +46 -0
- byteplussdkarkruntime/types/shared/__init__.py +21 -0
- byteplussdkarkruntime/types/shared/reasoning.py +10 -0
- byteplussdkarkruntime/types/shared/reasoning_effort.py +16 -0
- byteplussdkarkruntime/types/shared/response_format_json_object.py +22 -0
- byteplussdkarkruntime/types/shared/response_format_json_schema.py +56 -0
- byteplussdkarkruntime/types/shared/response_format_text.py +22 -0
- byteplussdkarkruntime/types/shared/thinking.py +25 -0
- byteplussdkarkruntime/types/shared_params/__init__.py +13 -0
- byteplussdkarkruntime/types/shared_params/function_definition.py +34 -0
- byteplussdkarkruntime/types/shared_params/function_parameters.py +9 -0
- byteplussdkarkruntime/types/shared_params/metadata.py +20 -0
- byteplussdkarkruntime/types/shared_params/reasoning.py +12 -0
- byteplussdkarkruntime/types/shared_params/reasoning_effort.py +8 -0
- byteplussdkarkruntime/types/shared_params/response_format_json_object.py +22 -0
- byteplussdkarkruntime/types/shared_params/response_format_json_schema.py +54 -0
- byteplussdkarkruntime/types/shared_params/response_format_text.py +22 -0
- byteplussdkarkruntime/types/shared_params/thinking.py +22 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing import List
|
|
16
|
+
from typing_extensions import Literal, TypedDict
|
|
17
|
+
|
|
18
|
+
from .response_includable import ResponseIncludable
|
|
19
|
+
|
|
20
|
+
__all__ = ["InputItemListParams"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class InputItemListParams(TypedDict, total=False):
|
|
24
|
+
after: str
|
|
25
|
+
"""An item ID to list items after, used in pagination."""
|
|
26
|
+
|
|
27
|
+
before: str
|
|
28
|
+
"""An item ID to list items before, used in pagination."""
|
|
29
|
+
|
|
30
|
+
include: List[ResponseIncludable]
|
|
31
|
+
"""Additional fields to include in the response.
|
|
32
|
+
|
|
33
|
+
See the `include` parameter for Response creation above for more information.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
limit: int
|
|
37
|
+
"""A limit on the number of objects to be returned.
|
|
38
|
+
|
|
39
|
+
Limit can range between 1 and 100, and the default is 20.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
order: Literal["asc", "desc"]
|
|
43
|
+
"""The order to return the input items in. Default is `desc`.
|
|
44
|
+
|
|
45
|
+
- `asc`: Return the input items in ascending order.
|
|
46
|
+
- `desc`: Return the input items in descending order.
|
|
47
|
+
"""
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing_extensions import TypedDict, Required, Optional, Iterable, Literal
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"McpListTools",
|
|
17
|
+
"McpListToolsTool",
|
|
18
|
+
"McpApprovalRequest",
|
|
19
|
+
"McpApprovalResponse",
|
|
20
|
+
"McpCall",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class McpListToolsTool(TypedDict, total=False):
|
|
25
|
+
input_schema: Required[object]
|
|
26
|
+
"""The JSON schema describing the tool's input."""
|
|
27
|
+
|
|
28
|
+
name: Required[str]
|
|
29
|
+
"""The name of the tool."""
|
|
30
|
+
|
|
31
|
+
annotations: Optional[object]
|
|
32
|
+
"""Additional annotations about the tool."""
|
|
33
|
+
|
|
34
|
+
description: Optional[str]
|
|
35
|
+
"""The description of the tool."""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class McpListTools(TypedDict, total=False):
|
|
39
|
+
id: Required[str]
|
|
40
|
+
"""The unique ID of the list."""
|
|
41
|
+
|
|
42
|
+
server_label: Required[str]
|
|
43
|
+
"""The label of the MCP server."""
|
|
44
|
+
|
|
45
|
+
tools: Required[Iterable[McpListToolsTool]]
|
|
46
|
+
"""The tools available on the server."""
|
|
47
|
+
|
|
48
|
+
type: Required[Literal["mcp_list_tools"]]
|
|
49
|
+
"""The type of the item. Always `mcp_list_tools`."""
|
|
50
|
+
|
|
51
|
+
error: Optional[str]
|
|
52
|
+
"""Error message if the server could not list tools."""
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class McpApprovalRequest(TypedDict, total=False):
|
|
56
|
+
id: Required[str]
|
|
57
|
+
"""The unique ID of the approval request."""
|
|
58
|
+
|
|
59
|
+
arguments: Required[str]
|
|
60
|
+
"""A JSON string of arguments for the tool."""
|
|
61
|
+
|
|
62
|
+
name: Required[str]
|
|
63
|
+
"""The name of the tool to run."""
|
|
64
|
+
|
|
65
|
+
server_label: Required[str]
|
|
66
|
+
"""The label of the MCP server making the request."""
|
|
67
|
+
|
|
68
|
+
type: Required[Literal["mcp_approval_request"]]
|
|
69
|
+
"""The type of the item. Always `mcp_approval_request`."""
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class McpApprovalResponse(TypedDict, total=False):
|
|
73
|
+
approval_request_id: Required[str]
|
|
74
|
+
"""The ID of the approval request being answered."""
|
|
75
|
+
|
|
76
|
+
approve: Required[bool]
|
|
77
|
+
"""Whether the request was approved."""
|
|
78
|
+
|
|
79
|
+
type: Required[Literal["mcp_approval_response"]]
|
|
80
|
+
"""The type of the item. Always `mcp_approval_response`."""
|
|
81
|
+
|
|
82
|
+
id: Optional[str]
|
|
83
|
+
"""The unique ID of the approval response"""
|
|
84
|
+
|
|
85
|
+
reason: Optional[str]
|
|
86
|
+
"""Optional reason for the decision."""
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class McpCall(TypedDict, total=False):
|
|
90
|
+
id: Required[str]
|
|
91
|
+
"""The unique ID of the tool call."""
|
|
92
|
+
|
|
93
|
+
arguments: Required[str]
|
|
94
|
+
"""A JSON string of the arguments passed to the tool."""
|
|
95
|
+
|
|
96
|
+
name: Required[str]
|
|
97
|
+
"""The name of the tool that was run."""
|
|
98
|
+
|
|
99
|
+
server_label: Required[str]
|
|
100
|
+
"""The label of the MCP server running the tool."""
|
|
101
|
+
|
|
102
|
+
type: Required[Literal["mcp_call"]]
|
|
103
|
+
"""The type of the item. Always `mcp_call`."""
|
|
104
|
+
|
|
105
|
+
error: Optional[str]
|
|
106
|
+
"""The error from the tool call, if any."""
|
|
107
|
+
|
|
108
|
+
output: Optional[str]
|
|
109
|
+
"""The output from the tool call."""
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing_extensions import Literal, Optional, Dict, TypeAlias, Union, List
|
|
14
|
+
|
|
15
|
+
from ..._models import BaseModel
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"Mcp",
|
|
20
|
+
"McpAllowedTools",
|
|
21
|
+
"McpAllowedToolsMcpAllowedToolsFilter",
|
|
22
|
+
"McpRequireApproval",
|
|
23
|
+
"McpRequireApprovalMcpToolApprovalFilter",
|
|
24
|
+
"McpRequireApprovalMcpToolApprovalFilterAlways",
|
|
25
|
+
"McpRequireApprovalMcpToolApprovalFilterNever",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class McpAllowedToolsMcpAllowedToolsFilter(BaseModel):
|
|
30
|
+
tool_names: Optional[List[str]] = None
|
|
31
|
+
"""List of allowed tool names."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class McpRequireApprovalMcpToolApprovalFilterAlways(BaseModel):
|
|
35
|
+
tool_names: Optional[List[str]] = None
|
|
36
|
+
"""List of tools that require approval."""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class McpRequireApprovalMcpToolApprovalFilterNever(BaseModel):
|
|
40
|
+
tool_names: Optional[List[str]] = None
|
|
41
|
+
"""List of tools that do not require approval."""
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class McpRequireApprovalMcpToolApprovalFilter(BaseModel):
|
|
45
|
+
always: Optional[McpRequireApprovalMcpToolApprovalFilterAlways] = None
|
|
46
|
+
"""A list of tools that always require approval."""
|
|
47
|
+
|
|
48
|
+
never: Optional[McpRequireApprovalMcpToolApprovalFilterNever] = None
|
|
49
|
+
"""A list of tools that never require approval."""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
McpAllowedTools: TypeAlias = Union[List[str], McpAllowedToolsMcpAllowedToolsFilter, None]
|
|
53
|
+
|
|
54
|
+
McpRequireApproval: TypeAlias = Union[McpRequireApprovalMcpToolApprovalFilter, Literal["always", "never"], None]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class Mcp(BaseModel):
|
|
58
|
+
server_label: str
|
|
59
|
+
"""A label for this MCP server, used to identify it in tool calls."""
|
|
60
|
+
|
|
61
|
+
server_url: str
|
|
62
|
+
"""The URL for the MCP server."""
|
|
63
|
+
|
|
64
|
+
type: Literal["mcp"]
|
|
65
|
+
"""The type of the MCP tool. Always `mcp`."""
|
|
66
|
+
|
|
67
|
+
allowed_tools: Optional[McpAllowedTools] = None
|
|
68
|
+
"""List of allowed tool names or a filter object."""
|
|
69
|
+
|
|
70
|
+
headers: Optional[Dict[str, str]] = None
|
|
71
|
+
"""Optional HTTP headers to send to the MCP server.
|
|
72
|
+
|
|
73
|
+
Use for authentication or other purposes.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
require_approval: Optional[McpRequireApproval] = None
|
|
77
|
+
"""Specify which of the MCP server's tools require approval."""
|
|
78
|
+
|
|
79
|
+
server_description: Optional[str] = None
|
|
80
|
+
"""Optional description of the MCP server, used to provide more context."""
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing_extensions import Literal, TypedDict, Required, Optional, Dict, TypeAlias, Union, List
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"Mcp",
|
|
17
|
+
"McpAllowedTools",
|
|
18
|
+
"McpAllowedToolsMcpAllowedToolsFilter",
|
|
19
|
+
"McpRequireApproval",
|
|
20
|
+
"McpRequireApprovalMcpToolApprovalFilter",
|
|
21
|
+
"McpRequireApprovalMcpToolApprovalFilterAlways",
|
|
22
|
+
"McpRequireApprovalMcpToolApprovalFilterNever",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class McpAllowedToolsMcpAllowedToolsFilter(TypedDict, total=False):
|
|
27
|
+
tool_names: List[str]
|
|
28
|
+
"""List of allowed tool names."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class McpRequireApprovalMcpToolApprovalFilterAlways(TypedDict, total=False):
|
|
32
|
+
tool_names: List[str]
|
|
33
|
+
"""List of tools that require approval."""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class McpRequireApprovalMcpToolApprovalFilterNever(TypedDict, total=False):
|
|
37
|
+
tool_names: List[str]
|
|
38
|
+
"""List of tools that do not require approval."""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class McpRequireApprovalMcpToolApprovalFilter(TypedDict, total=False):
|
|
42
|
+
always: McpRequireApprovalMcpToolApprovalFilterAlways
|
|
43
|
+
"""A list of tools that always require approval."""
|
|
44
|
+
|
|
45
|
+
never: McpRequireApprovalMcpToolApprovalFilterNever
|
|
46
|
+
"""A list of tools that never require approval."""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
McpAllowedTools: TypeAlias = Union[List[str], McpAllowedToolsMcpAllowedToolsFilter]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
McpRequireApproval: TypeAlias = Union[McpRequireApprovalMcpToolApprovalFilter, Literal["always", "never"]]
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class Mcp(TypedDict, total=False):
|
|
56
|
+
server_label: Required[str]
|
|
57
|
+
"""A label for this MCP server, used to identify it in tool calls."""
|
|
58
|
+
|
|
59
|
+
server_url: Required[str]
|
|
60
|
+
"""The URL for the MCP server."""
|
|
61
|
+
|
|
62
|
+
type: Required[Literal["mcp"]]
|
|
63
|
+
"""The type of the MCP tool. Always `mcp`."""
|
|
64
|
+
|
|
65
|
+
allowed_tools: Optional[McpAllowedTools]
|
|
66
|
+
"""List of allowed tool names or a filter object."""
|
|
67
|
+
|
|
68
|
+
headers: Optional[Dict[str, str]]
|
|
69
|
+
"""Optional HTTP headers to send to the MCP server.
|
|
70
|
+
|
|
71
|
+
Use for authentication or other purposes.
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
require_approval: Optional[McpRequireApproval]
|
|
75
|
+
"""Specify which of the MCP server's tools require approval."""
|
|
76
|
+
|
|
77
|
+
server_description: str
|
|
78
|
+
"""Optional description of the MCP server, used to provide more context."""
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing import List, Union, Optional
|
|
14
|
+
from typing_extensions import Literal, TypeAlias
|
|
15
|
+
|
|
16
|
+
from .tool import Tool
|
|
17
|
+
from ..._models import BaseModel
|
|
18
|
+
from .response_error import ResponseError
|
|
19
|
+
from .response_usage import ResponseUsage
|
|
20
|
+
from .response_status import ResponseStatus
|
|
21
|
+
from byteplussdkarkruntime.types.shared.thinking import Thinking
|
|
22
|
+
from .tool_choice_options import ToolChoiceOptions
|
|
23
|
+
from .response_output_item import ResponseOutputItem
|
|
24
|
+
from .response_text_config import ResponseTextConfig
|
|
25
|
+
from .tool_choice_function import ToolChoiceFunction
|
|
26
|
+
from .response_incomplete_details import IncompleteDetails
|
|
27
|
+
from .response_caching import ResponseCaching
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = ["Response", "ToolChoice"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
ToolChoice: TypeAlias = Union[ToolChoiceOptions, ToolChoiceFunction]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Response(BaseModel):
|
|
37
|
+
id: str
|
|
38
|
+
"""Unique identifier for this Response."""
|
|
39
|
+
|
|
40
|
+
created_at: float
|
|
41
|
+
"""Unix timestamp (in seconds) of when this Response was created."""
|
|
42
|
+
|
|
43
|
+
error: Optional[ResponseError] = None
|
|
44
|
+
"""An error object returned when the model fails to generate a Response."""
|
|
45
|
+
|
|
46
|
+
incomplete_details: Optional[IncompleteDetails] = None
|
|
47
|
+
"""Details about why the response is incomplete."""
|
|
48
|
+
|
|
49
|
+
instructions: Optional[str] = None
|
|
50
|
+
"""
|
|
51
|
+
Inserts a system (or developer) message as the first item in the model's
|
|
52
|
+
context.
|
|
53
|
+
|
|
54
|
+
When using along with `previous_response_id`, the instructions from a previous
|
|
55
|
+
response will not be carried over to the next response. This makes it simple to
|
|
56
|
+
swap out system (or developer) messages in new responses.
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
model: str
|
|
60
|
+
"""Model Name or endpoint id."""
|
|
61
|
+
|
|
62
|
+
object: Literal["response"]
|
|
63
|
+
"""The object type of this resource - always set to `response`."""
|
|
64
|
+
|
|
65
|
+
output: List[ResponseOutputItem]
|
|
66
|
+
"""An array of content items generated by the model.
|
|
67
|
+
|
|
68
|
+
- The length and order of items in the `output` array is dependent on the
|
|
69
|
+
model's response.
|
|
70
|
+
- Rather than accessing the first item in the `output` array and assuming it's
|
|
71
|
+
an `assistant` message with the content generated by the model, you might
|
|
72
|
+
consider using the `output_text` property where supported in SDKs.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
parallel_tool_calls: bool
|
|
76
|
+
"""Whether to allow the model to run tool calls in parallel."""
|
|
77
|
+
|
|
78
|
+
temperature: Optional[float] = None
|
|
79
|
+
"""What sampling temperature to use, between 0 and 2.
|
|
80
|
+
|
|
81
|
+
Higher values like 0.8 will make the output more random, while lower values like
|
|
82
|
+
0.2 will make it more focused and deterministic. We generally recommend altering
|
|
83
|
+
this or `top_p` but not both.
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
tool_choice: ToolChoice
|
|
87
|
+
"""
|
|
88
|
+
How the model should select which tool (or tools) to use when generating a
|
|
89
|
+
response. See the `tools` parameter to see how to specify which tools the model
|
|
90
|
+
can call.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
tools: List[Tool]
|
|
94
|
+
"""
|
|
95
|
+
An array of tools the model may call while generating a response.
|
|
96
|
+
|
|
97
|
+
You can specify which tool to use by setting the `tool_choice` parameter.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
top_p: Optional[float] = None
|
|
101
|
+
"""
|
|
102
|
+
An alternative to sampling with temperature, called nucleus sampling, where the
|
|
103
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
|
104
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
|
105
|
+
|
|
106
|
+
We generally recommend altering this or `temperature` but not both.
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
max_output_tokens: Optional[int] = None
|
|
110
|
+
"""
|
|
111
|
+
An upper bound for the number of tokens that can be generated for a response.
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
previous_response_id: Optional[str] = None
|
|
115
|
+
"""The unique ID of the previous response to the model.
|
|
116
|
+
|
|
117
|
+
Use this to create multi-turn conversations.
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
thinking: Optional[Thinking] = None
|
|
121
|
+
"""
|
|
122
|
+
The thinking mode to use for the model.
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
service_tier: Optional[Literal["auto", "default"]] = None
|
|
126
|
+
"""
|
|
127
|
+
Specifies the latency tier to use for processing the request.
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
status: Optional[ResponseStatus] = None
|
|
131
|
+
"""The status of the response generation.
|
|
132
|
+
|
|
133
|
+
One of `completed`, `failed`, `in_progress`, or `incomplete`.
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
text: Optional[ResponseTextConfig] = None
|
|
137
|
+
"""Configuration options for a text response from the model.
|
|
138
|
+
|
|
139
|
+
Can be plain text or json object
|
|
140
|
+
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
usage: Optional[ResponseUsage] = None
|
|
144
|
+
"""
|
|
145
|
+
Represents token usage details including input tokens, output tokens, a
|
|
146
|
+
breakdown of output tokens, and the total tokens used.
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
caching: Optional[ResponseCaching] = None
|
|
150
|
+
"""
|
|
151
|
+
Represents the caching configuration for the response.
|
|
152
|
+
"""
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing_extensions import Literal
|
|
14
|
+
|
|
15
|
+
from ..._models import BaseModel
|
|
16
|
+
from .response_output_text import ResponseOutputTextAnnotation
|
|
17
|
+
|
|
18
|
+
__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."""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing import Optional
|
|
14
|
+
from typing_extensions import Literal
|
|
15
|
+
|
|
16
|
+
from pydantic import BaseModel
|
|
17
|
+
|
|
18
|
+
__all__ = ["ResponseCaching"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ResponseCaching(BaseModel):
|
|
22
|
+
type: Optional[Literal["enabled", "disabled"]]
|
|
23
|
+
"""
|
|
24
|
+
Whether to enable caching.
|
|
25
|
+
"""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
16
|
+
|
|
17
|
+
__all__ = ["ResponseCaching"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseCaching(TypedDict, total=False):
|
|
21
|
+
type: Required[Literal["disabled", "enabled"]]
|
|
22
|
+
"""The type of caching."""
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing_extensions import Literal
|
|
14
|
+
|
|
15
|
+
from .response import Response
|
|
16
|
+
from ..._models import BaseModel
|
|
17
|
+
|
|
18
|
+
__all__ = ["ResponseCompletedEvent"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ResponseCompletedEvent(BaseModel):
|
|
22
|
+
response: Response
|
|
23
|
+
"""Properties of the completed response."""
|
|
24
|
+
|
|
25
|
+
type: Literal["response.completed"]
|
|
26
|
+
"""The type of the event. Always `response.completed`."""
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing import Union
|
|
14
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
|
15
|
+
|
|
16
|
+
from ..._utils import PropertyInfo
|
|
17
|
+
from ..._models import BaseModel
|
|
18
|
+
from .response_output_text import ResponseOutputText
|
|
19
|
+
|
|
20
|
+
__all__ = ["ResponseContentPartAddedEvent", "Part"]
|
|
21
|
+
|
|
22
|
+
Part: TypeAlias = Annotated[Union[ResponseOutputText], PropertyInfo(discriminator="type")]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ResponseContentPartAddedEvent(BaseModel):
|
|
26
|
+
content_index: int
|
|
27
|
+
"""The index of the content part that was added."""
|
|
28
|
+
|
|
29
|
+
item_id: str
|
|
30
|
+
"""The ID of the output item that the content part was added to."""
|
|
31
|
+
|
|
32
|
+
output_index: int
|
|
33
|
+
"""The index of the output item that the content part was added to."""
|
|
34
|
+
|
|
35
|
+
part: Part
|
|
36
|
+
"""The content part that was added."""
|
|
37
|
+
|
|
38
|
+
type: Literal["response.content_part.added"]
|
|
39
|
+
"""The type of the event. Always `response.content_part.added`."""
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from typing import Union
|
|
14
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
|
15
|
+
|
|
16
|
+
from ..._utils import PropertyInfo
|
|
17
|
+
from ..._models import BaseModel
|
|
18
|
+
from .response_output_text import ResponseOutputText
|
|
19
|
+
|
|
20
|
+
__all__ = ["ResponseContentPartDoneEvent", "Part"]
|
|
21
|
+
|
|
22
|
+
Part: TypeAlias = Annotated[Union[ResponseOutputText], PropertyInfo(discriminator="type")]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ResponseContentPartDoneEvent(BaseModel):
|
|
26
|
+
content_index: int
|
|
27
|
+
"""The index of the content part that is done."""
|
|
28
|
+
|
|
29
|
+
item_id: str
|
|
30
|
+
"""The ID of the output item that the content part was added to."""
|
|
31
|
+
|
|
32
|
+
output_index: int
|
|
33
|
+
"""The index of the output item that the content part was added to."""
|
|
34
|
+
|
|
35
|
+
part: Part
|
|
36
|
+
"""The content part that is done."""
|
|
37
|
+
|
|
38
|
+
type: Literal["response.content_part.done"]
|
|
39
|
+
"""The type of the event. Always `response.content_part.done`."""
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
# Copyright (c) [2025] [OpenAI]
|
|
3
|
+
# Copyright (c) [2025] [ByteDance Ltd. and/or its affiliates.]
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified by [ByteDance Ltd. and/or its affiliates.] on 2025.7
|
|
7
|
+
#
|
|
8
|
+
# Original file was released under Apache License Version 2.0, with the full license text
|
|
9
|
+
# available at https://github.com/openai/openai-python/blob/main/LICENSE.
|
|
10
|
+
#
|
|
11
|
+
# This modified file is released under the same license.
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing import Union
|
|
16
|
+
from typing_extensions import TypeAlias
|
|
17
|
+
|
|
18
|
+
from .tool_choice_options import ToolChoiceOptions
|
|
19
|
+
from .tool_choice_function_param import ToolChoiceFunctionParam
|
|
20
|
+
from .tool_choice_mcp_param import ToolChoiceMcpParam
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
"ToolChoice",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
ToolChoice: TypeAlias = Union[ToolChoiceOptions, ToolChoiceFunctionParam, ToolChoiceMcpParam]
|