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,31 @@
|
|
|
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 TypedDict
|
|
16
|
+
|
|
17
|
+
from .response_format_text_config_param import ResponseFormatTextConfigParam
|
|
18
|
+
|
|
19
|
+
__all__ = ["ResponseTextConfigParam"]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ResponseTextConfigParam(TypedDict, total=False):
|
|
23
|
+
format: ResponseFormatTextConfigParam
|
|
24
|
+
"""An object specifying the format that the model must output.
|
|
25
|
+
|
|
26
|
+
The default format is `{ "type": "text" }` with no additional options.
|
|
27
|
+
|
|
28
|
+
Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
|
29
|
+
ensures the message the model generates is valid JSON. Using `json_schema` is
|
|
30
|
+
preferred for models that support it.
|
|
31
|
+
"""
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
|
|
17
|
+
__all__ = ["ResponseTextDeltaEvent"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseTextDeltaEvent(BaseModel):
|
|
21
|
+
content_index: int
|
|
22
|
+
"""The index of the content part that the text delta was added to."""
|
|
23
|
+
|
|
24
|
+
delta: str
|
|
25
|
+
"""The text delta that was added."""
|
|
26
|
+
|
|
27
|
+
item_id: str
|
|
28
|
+
"""The ID of the output item that the text delta was added to."""
|
|
29
|
+
|
|
30
|
+
output_index: int
|
|
31
|
+
"""The index of the output item that the text delta was added to."""
|
|
32
|
+
|
|
33
|
+
type: Literal["response.output_text.delta"]
|
|
34
|
+
"""The type of the event. Always `response.output_text.delta`."""
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
|
|
17
|
+
__all__ = ["ResponseTextDoneEvent"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseTextDoneEvent(BaseModel):
|
|
21
|
+
content_index: int
|
|
22
|
+
"""The index of the content part that the text content is finalized."""
|
|
23
|
+
|
|
24
|
+
item_id: str
|
|
25
|
+
"""The ID of the output item that the text content is finalized."""
|
|
26
|
+
|
|
27
|
+
output_index: int
|
|
28
|
+
"""The index of the output item that the text content is finalized."""
|
|
29
|
+
|
|
30
|
+
text: str
|
|
31
|
+
"""The text content that is finalized."""
|
|
32
|
+
|
|
33
|
+
type: Literal["response.output_text.done"]
|
|
34
|
+
"""The type of the event. Always `response.output_text.done`."""
|
|
@@ -0,0 +1,32 @@
|
|
|
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 Dict, Optional
|
|
14
|
+
|
|
15
|
+
from ..._models import BaseModel
|
|
16
|
+
|
|
17
|
+
__all__ = ["ToolUsage", "ToolUsageDetails"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ToolUsage(BaseModel):
|
|
21
|
+
web_search: Optional[int]
|
|
22
|
+
"""The usage of web search tools."""
|
|
23
|
+
mcp: Optional[int]
|
|
24
|
+
"""The usage of MCP tools."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ToolUsageDetails(BaseModel):
|
|
28
|
+
web_search: Optional[Dict[str, int]]
|
|
29
|
+
"""The usage of web search tools."""
|
|
30
|
+
mcp: Optional[Dict[str, int]]
|
|
31
|
+
"""The usage of MCP tools."""
|
|
32
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
|
|
15
|
+
from ..._models import BaseModel
|
|
16
|
+
from .response_tool_usage import ToolUsage, ToolUsageDetails
|
|
17
|
+
|
|
18
|
+
__all__ = ["ResponseUsage", "InputTokensDetails", "OutputTokensDetails"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class InputTokensDetails(BaseModel):
|
|
22
|
+
cached_tokens: int
|
|
23
|
+
"""The number of tokens that were retrieved from the cache.
|
|
24
|
+
|
|
25
|
+
[More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class OutputTokensDetails(BaseModel):
|
|
30
|
+
reasoning_tokens: int
|
|
31
|
+
"""The number of reasoning tokens."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class ResponseUsage(BaseModel):
|
|
35
|
+
input_tokens: int
|
|
36
|
+
"""The number of input tokens."""
|
|
37
|
+
|
|
38
|
+
input_tokens_details: InputTokensDetails
|
|
39
|
+
"""A detailed breakdown of the input tokens."""
|
|
40
|
+
|
|
41
|
+
output_tokens: int
|
|
42
|
+
"""The number of output tokens."""
|
|
43
|
+
|
|
44
|
+
output_tokens_details: OutputTokensDetails
|
|
45
|
+
"""A detailed breakdown of the output tokens."""
|
|
46
|
+
|
|
47
|
+
total_tokens: int
|
|
48
|
+
"""The total number of tokens used."""
|
|
49
|
+
|
|
50
|
+
tool_usage: Optional[ToolUsage]
|
|
51
|
+
"""The usage of tools."""
|
|
52
|
+
|
|
53
|
+
tool_usage_details: Optional[ToolUsageDetails]
|
|
54
|
+
"""A detailed breakdown of the tool usage."""
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
|
|
17
|
+
__all__ = ["ResponseWebSearchCallCompletedEvent"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseWebSearchCallCompletedEvent(BaseModel):
|
|
21
|
+
|
|
22
|
+
item_id: str
|
|
23
|
+
"""The ID of the item this event is associated with."""
|
|
24
|
+
|
|
25
|
+
output_index: int
|
|
26
|
+
"""The index of the output item this event is associated with."""
|
|
27
|
+
|
|
28
|
+
type: Literal["response.web_search_call.completed"]
|
|
29
|
+
"""The type of the event. Always `response.web_search_call.completed`."""
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
|
|
17
|
+
__all__ = ["ResponseWebSearchCallInProgressEvent"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseWebSearchCallInProgressEvent(BaseModel):
|
|
21
|
+
|
|
22
|
+
item_id: str
|
|
23
|
+
"""The ID of the item this event is associated with."""
|
|
24
|
+
|
|
25
|
+
output_index: int
|
|
26
|
+
"""The index of the output item this event is associated with."""
|
|
27
|
+
|
|
28
|
+
type: Literal["response.web_search_call.in_progress"]
|
|
29
|
+
"""The type of the event. Always `response.web_search_call.in_progress`."""
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
|
|
17
|
+
__all__ = ["ResponseWebSearchCallSearchingEvent"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseWebSearchCallSearchingEvent(BaseModel):
|
|
21
|
+
|
|
22
|
+
item_id: str
|
|
23
|
+
"""The ID of the item this event is associated with."""
|
|
24
|
+
|
|
25
|
+
output_index: int
|
|
26
|
+
"""The index of the output item this event is associated with."""
|
|
27
|
+
|
|
28
|
+
type: Literal["response.web_search_call.searching"]
|
|
29
|
+
"""The type of the event. Always `response.web_search_call.searching`."""
|
|
@@ -0,0 +1,43 @@
|
|
|
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 ..._models import BaseModel
|
|
17
|
+
|
|
18
|
+
__all__ = ["ResponseWebSearchItem"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ResponseWebSearchAction(BaseModel):
|
|
22
|
+
query: str
|
|
23
|
+
"""The query of the web search action."""
|
|
24
|
+
type: Literal["search"]
|
|
25
|
+
"""The type of the action. Always `search`."""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ResponseWebSearchItem(BaseModel):
|
|
29
|
+
id: str
|
|
30
|
+
"""The unique identifier of the web search item."""
|
|
31
|
+
|
|
32
|
+
action: Optional[ResponseWebSearchAction] = None
|
|
33
|
+
"""The action of the web search item."""
|
|
34
|
+
|
|
35
|
+
type: Literal["web_search_call"]
|
|
36
|
+
"""The type of the object. Always `web_search_call`."""
|
|
37
|
+
|
|
38
|
+
status: Optional[Literal["in_progress", "completed", "incomplete"]] = None
|
|
39
|
+
"""The status of the item.
|
|
40
|
+
|
|
41
|
+
One of `in_progress`, `completed`, or `incomplete`. Populated when items are
|
|
42
|
+
returned via API.
|
|
43
|
+
"""
|
|
@@ -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 Union
|
|
14
|
+
from typing_extensions import Annotated, TypeAlias
|
|
15
|
+
|
|
16
|
+
from ..._utils import PropertyInfo
|
|
17
|
+
from .function_tool import FunctionTool
|
|
18
|
+
from .mcp_tool import Mcp
|
|
19
|
+
from .web_search_tool import WebSearchTool
|
|
20
|
+
|
|
21
|
+
__all__ = ["Tool"]
|
|
22
|
+
|
|
23
|
+
Tool: TypeAlias = Annotated[
|
|
24
|
+
Union[FunctionTool, WebSearchTool, Mcp], PropertyInfo(discriminator="type")
|
|
25
|
+
]
|
|
@@ -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_extensions import Literal
|
|
14
|
+
|
|
15
|
+
from ..._models import BaseModel
|
|
16
|
+
|
|
17
|
+
__all__ = ["ToolChoiceFunction"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ToolChoiceFunction(BaseModel):
|
|
21
|
+
name: str
|
|
22
|
+
"""The name of the function to call."""
|
|
23
|
+
|
|
24
|
+
type: Literal["function"]
|
|
25
|
+
"""For function calling, the type is always `function`."""
|
|
@@ -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 __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
16
|
+
|
|
17
|
+
__all__ = ["ToolChoiceFunctionParam"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ToolChoiceFunctionParam(TypedDict, total=False):
|
|
21
|
+
name: Required[str]
|
|
22
|
+
"""The name of the function to call."""
|
|
23
|
+
|
|
24
|
+
type: Required[Literal["function"]]
|
|
25
|
+
"""For function calling, the type is always `function`."""
|
|
@@ -0,0 +1,29 @@
|
|
|
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 Optional
|
|
16
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
17
|
+
|
|
18
|
+
__all__ = ["ToolChoiceMcpParam"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ToolChoiceMcpParam(TypedDict, total=False):
|
|
22
|
+
server_label: Required[str]
|
|
23
|
+
"""The label of the MCP server to use."""
|
|
24
|
+
|
|
25
|
+
type: Required[Literal["mcp"]]
|
|
26
|
+
"""For MCP tools, the type is always `mcp`."""
|
|
27
|
+
|
|
28
|
+
name: Optional[str]
|
|
29
|
+
"""The name of the tool to call on the server."""
|
|
@@ -0,0 +1,17 @@
|
|
|
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, TypeAlias
|
|
14
|
+
|
|
15
|
+
__all__ = ["ToolChoiceOptions"]
|
|
16
|
+
|
|
17
|
+
ToolChoiceOptions: TypeAlias = Literal["none", "auto", "required"]
|
|
@@ -0,0 +1,24 @@
|
|
|
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 .function_tool_param import FunctionToolParam
|
|
19
|
+
from .web_search_tool_param import WebSearchToolParam
|
|
20
|
+
from .mcp_tool_param import Mcp
|
|
21
|
+
|
|
22
|
+
__all__ = ["ToolParam"]
|
|
23
|
+
|
|
24
|
+
ToolParam: TypeAlias = Union[FunctionToolParam, WebSearchToolParam, Mcp]
|
|
@@ -0,0 +1,49 @@
|
|
|
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, Required, Optional, List
|
|
14
|
+
|
|
15
|
+
from ..._models import BaseModel
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"WebSearchTool",
|
|
19
|
+
"UserLocation",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class UserLocation(BaseModel):
|
|
24
|
+
type: Literal["approximate"]
|
|
25
|
+
"""The type of the user location. Always `approximate`."""
|
|
26
|
+
city: Optional[str]
|
|
27
|
+
"""The city of the user location."""
|
|
28
|
+
country: Optional[str]
|
|
29
|
+
"""The country of the user location."""
|
|
30
|
+
region: Optional[str]
|
|
31
|
+
"""The region of the user location."""
|
|
32
|
+
timezone: Optional[float]
|
|
33
|
+
"""The timezone of the user location."""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class WebSearchTool(BaseModel):
|
|
37
|
+
|
|
38
|
+
type: Literal["web_search"]
|
|
39
|
+
"""The type of the web search. Always `web_search`."""
|
|
40
|
+
|
|
41
|
+
limit: Optional[int]
|
|
42
|
+
"""The maximum number of results to return. Defaults to 3."""
|
|
43
|
+
|
|
44
|
+
sources: Optional[List[Literal["toutiao", "douyin", "moji", "search_engine"]]]
|
|
45
|
+
"""The source type of web search."""
|
|
46
|
+
|
|
47
|
+
user_location: Optional[UserLocation]
|
|
48
|
+
"""The user location."""
|
|
49
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
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 Optional, List
|
|
16
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
17
|
+
|
|
18
|
+
__all__ = ["WebSearchToolParam"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class WebSearchToolParam(TypedDict, total=False):
|
|
22
|
+
|
|
23
|
+
type: Required[Literal["web_search"]]
|
|
24
|
+
"""The type of the web search. Always `web_search`."""
|
|
25
|
+
|
|
26
|
+
limit: Optional[int]
|
|
27
|
+
"""The maximum number of results to return. Defaults to 3."""
|
|
28
|
+
|
|
29
|
+
sources: Optional[List[Literal["toutiao", "douyin", "moji", "search_engine"]]]
|
|
30
|
+
"""The source type of web search."""
|
|
31
|
+
|
|
32
|
+
user_location: Optional[UserLocationParam]
|
|
33
|
+
"""The user location."""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class UserLocationParam(TypedDict, total=False):
|
|
37
|
+
type: Required[Literal["approximate"]]
|
|
38
|
+
"""The type of the user location. Always `approximate`."""
|
|
39
|
+
city: Optional[str]
|
|
40
|
+
"""The city of the user location."""
|
|
41
|
+
country: Optional[str]
|
|
42
|
+
"""The country of the user location."""
|
|
43
|
+
region: Optional[str]
|
|
44
|
+
"""The region of the user location."""
|
|
45
|
+
timezone: Optional[float]
|
|
46
|
+
"""The timezone of the user location."""
|
|
@@ -0,0 +1,21 @@
|
|
|
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 .response_format_text import ResponseFormatText as ResponseFormatText
|
|
13
|
+
from .response_format_json_object import (
|
|
14
|
+
ResponseFormatJSONObject as ResponseFormatJSONObject,
|
|
15
|
+
)
|
|
16
|
+
from .response_format_json_schema import (
|
|
17
|
+
ResponseFormatJSONSchema as ResponseFormatJSONSchema,
|
|
18
|
+
)
|
|
19
|
+
from .reasoning import Reasoning as Reasoning
|
|
20
|
+
|
|
21
|
+
from .reasoning_effort import ReasoningEffort as ReasoningEffort
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
from typing import Optional
|
|
12
|
+
from typing_extensions import Literal, TypeAlias
|
|
13
|
+
|
|
14
|
+
__all__ = ["ReasoningEffort"]
|
|
15
|
+
|
|
16
|
+
ReasoningEffort: TypeAlias = Optional[Literal["minimal", "low", "medium", "high"]]
|
|
@@ -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 typing_extensions import Literal
|
|
14
|
+
|
|
15
|
+
from ..._models import BaseModel
|
|
16
|
+
|
|
17
|
+
__all__ = ["ResponseFormatJSONObject"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseFormatJSONObject(BaseModel):
|
|
21
|
+
type: Literal["json_object"]
|
|
22
|
+
"""The type of response format being defined. Always `json_object`."""
|