diff --git a/VERSION b/VERSION index a551051..04a373e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.15.0 +0.16.0 diff --git a/pyproject.toml b/pyproject.toml index e48ed04..a40a2bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "arkruntime" -version = "0.15.0" +version = "0.16.0" description = "Ark runtime SDK for Python" readme = "README.md" requires-python = ">=3.8" diff --git a/src/arkruntime/types/audio_generation/audio_url.py b/src/arkruntime/types/audio_generation/audio_url.py index 5c2c716..72b670b 100644 --- a/src/arkruntime/types/audio_generation/audio_url.py +++ b/src/arkruntime/types/audio_generation/audio_url.py @@ -14,5 +14,5 @@ class AudioURL(BaseModel): url: NonEmptyString """ - Public HTTP(S) URL, speaker://, file:// for registered reference audio, or data:audio/{wav,mp3};base64,. Decoded base64 audio is limited to 15 MiB for reference generation; separation uses a 90 MiB source-audio limit. A speaker reference cannot be used for separation. + Public HTTP(S) URL, speaker:// for a preset speaker, file:// for a custom voice registered through the Files API, or data:audio/{wav,mp3};base64,. Voice-cloning speaker IDs are not supported. Decoded base64 audio is limited to 15 MiB for reference generation; separation uses a 90 MiB source-audio limit. A speaker reference cannot be used for separation. """ diff --git a/src/arkruntime/types/audio_generation/audio_url_param.py b/src/arkruntime/types/audio_generation/audio_url_param.py index 3da0064..83354b8 100644 --- a/src/arkruntime/types/audio_generation/audio_url_param.py +++ b/src/arkruntime/types/audio_generation/audio_url_param.py @@ -14,4 +14,4 @@ class AudioURLParam(TypedDict, total=False): url: Required[NonEmptyStringParam] - """Public HTTP(S) URL, speaker://, file:// for registered reference audio, or data:audio/{wav,mp3};base64,. Decoded base64 audio is limited to 15 MiB for reference generation; separation uses a 90 MiB source-audio limit. A speaker reference cannot be used for separation.""" + """Public HTTP(S) URL, speaker:// for a preset speaker, file:// for a custom voice registered through the Files API, or data:audio/{wav,mp3};base64,. Voice-cloning speaker IDs are not supported. Decoded base64 audio is limited to 15 MiB for reference generation; separation uses a 90 MiB source-audio limit. A speaker reference cannot be used for separation.""" diff --git a/src/arkruntime/types/audio_generation/video_url.py b/src/arkruntime/types/audio_generation/video_url.py index cba99e0..d0f90fd 100644 --- a/src/arkruntime/types/audio_generation/video_url.py +++ b/src/arkruntime/types/audio_generation/video_url.py @@ -14,5 +14,5 @@ class VideoURL(BaseModel): url: NonEmptyString """ - Public HTTP(S) URL or tos:///. Base64 and speaker references are not supported. Media properties and size are validated by the server. + Public HTTP(S) URL or tos:///. Supported video resolutions: 360p, 480p, 720p and 1080p; minimum total pixel count (width * height): 172800. Base64 and speaker references are not supported. Media properties and size are validated by the server. """ diff --git a/src/arkruntime/types/audio_generation/video_url_param.py b/src/arkruntime/types/audio_generation/video_url_param.py index 79923d4..e48062f 100644 --- a/src/arkruntime/types/audio_generation/video_url_param.py +++ b/src/arkruntime/types/audio_generation/video_url_param.py @@ -14,4 +14,4 @@ class VideoURLParam(TypedDict, total=False): url: Required[NonEmptyStringParam] - """Public HTTP(S) URL or tos:///. Base64 and speaker references are not supported. Media properties and size are validated by the server.""" + """Public HTTP(S) URL or tos:///. Supported video resolutions: 360p, 480p, 720p and 1080p; minimum total pixel count (width * height): 172800. Base64 and speaker references are not supported. Media properties and size are validated by the server.""" diff --git a/src/arkruntime/types/responses/__init__.py b/src/arkruntime/types/responses/__init__.py index f59e2cd..4e887e4 100644 --- a/src/arkruntime/types/responses/__init__.py +++ b/src/arkruntime/types/responses/__init__.py @@ -66,6 +66,8 @@ from .item_reasoning import ItemReasoning from .item_reference import ItemReference from .item_status import ItemStatus +from .item_tool_search_call import ItemToolSearchCall +from .item_tool_search_output import ItemToolSearchOutput from .item_transcription import ItemTranscription from .knowledge_search_tool import KnowledgeSearchTool from .list_input_items_response import ListInputItemsResponse @@ -80,6 +82,7 @@ from .mcp_tool_approval_filter_never import McpToolApprovalFilterNever from .message_content import MessageContent from .message_role import MessageRole +from .namespace_tool import NamespaceTool from .order import Order from .output_content_item import OutputContentItem from .output_content_item_reasoning_text import OutputContentItemReasoningText @@ -248,6 +251,9 @@ from .tool_choice_options import ToolChoiceOptions from .tool_choice_web_search import ToolChoiceWebSearch from .tool_name_list import ToolNameList +from .tool_search_execution import ToolSearchExecution +from .tool_search_result_tool import ToolSearchResultTool +from .tool_search_tool import ToolSearchTool from .tool_usage import ToolUsage from .tool_usage_details import ToolUsageDetails from .tool_uses_keep import ToolUsesKeep @@ -322,6 +328,8 @@ "ItemReasoning", "ItemReference", "ItemStatus", + "ItemToolSearchCall", + "ItemToolSearchOutput", "ItemTranscription", "KnowledgeSearchTool", "ListInputItemsResponse", @@ -336,6 +344,7 @@ "McpToolApprovalFilterNever", "MessageContent", "MessageRole", + "NamespaceTool", "Order", "OutputContentItem", "OutputContentItemReasoningText", @@ -436,6 +445,9 @@ "ToolChoiceOptions", "ToolChoiceWebSearch", "ToolNameList", + "ToolSearchExecution", + "ToolSearchResultTool", + "ToolSearchTool", "ToolUsage", "ToolUsageDetails", "ToolUsesKeep", @@ -485,6 +497,8 @@ from .item_function_tool_call_output_param import ItemFunctionToolCallOutputParam from .item_function_tool_call_param import ItemFunctionToolCallParam from .item_reasoning_param import ItemReasoningParam +from .item_tool_search_call_param import ItemToolSearchCallParam +from .item_tool_search_output_param import ItemToolSearchOutputParam from .knowledge_search_tool_param import KnowledgeSearchToolParam from .mcp_allowed_tools_filter_param import McpAllowedToolsFilterParam from .mcp_allowed_tools_param import McpAllowedToolsParam @@ -495,6 +509,7 @@ from .mcp_tool_approval_filter_param import McpToolApprovalFilterParam from .mcp_tool_param import McpToolParam from .message_content_param import MessageContentParam +from .namespace_tool_param import NamespaceToolParam from .output_content_item_param import OutputContentItemParam from .output_content_item_reasoning_text_param import ( OutputContentItemReasoningTextParam, @@ -517,6 +532,8 @@ from .tool_choice_web_search_param import ToolChoiceWebSearchParam from .tool_name_list_param import ToolNameListParam from .tool_param import ToolParam +from .tool_search_result_tool_param import ToolSearchResultToolParam +from .tool_search_tool_param import ToolSearchToolParam from .tool_uses_keep_param import ToolUsesKeepParam from .tool_uses_trigger_param import ToolUsesTriggerParam from .typed_tool_choice_param import TypedToolChoiceParam diff --git a/src/arkruntime/types/responses/function_tool.py b/src/arkruntime/types/responses/function_tool.py index 7b95569..9253bc6 100644 --- a/src/arkruntime/types/responses/function_tool.py +++ b/src/arkruntime/types/responses/function_tool.py @@ -30,3 +30,7 @@ class FunctionTool(BaseModel): Used by the model to determine whether or not to call the function. """ + defer_loading: Optional[bool] = None + """ + Defer the full schema until tool_search loads this function. Defaults to false. + """ diff --git a/src/arkruntime/types/responses/function_tool_param.py b/src/arkruntime/types/responses/function_tool_param.py index 208dfea..1f50cd8 100644 --- a/src/arkruntime/types/responses/function_tool_param.py +++ b/src/arkruntime/types/responses/function_tool_param.py @@ -27,3 +27,6 @@ class FunctionToolParam(TypedDict, total=False): Used by the model to determine whether or not to call the function. """ + + defer_loading: Optional[bool] + """Defer the full schema until tool_search loads this function. Defaults to false.""" diff --git a/src/arkruntime/types/responses/input_item.py b/src/arkruntime/types/responses/input_item.py index 0d7a39a..dc072a4 100644 --- a/src/arkruntime/types/responses/input_item.py +++ b/src/arkruntime/types/responses/input_item.py @@ -19,6 +19,8 @@ from .item_function_tool_call import ItemFunctionToolCall from .item_function_tool_call_output import ItemFunctionToolCallOutput from .item_reasoning import ItemReasoning +from .item_tool_search_call import ItemToolSearchCall +from .item_tool_search_output import ItemToolSearchOutput InputItem = TypeAliasType( "InputItem", @@ -26,6 +28,8 @@ Union[ ItemEasyMessage, ItemFunctionToolCall, + ItemToolSearchCall, + ItemToolSearchOutput, ItemFunctionToolCallOutput, ItemReasoning, ItemFunctionMcpApprovalRequest, diff --git a/src/arkruntime/types/responses/input_item_param.py b/src/arkruntime/types/responses/input_item_param.py index 703367b..3edc924 100644 --- a/src/arkruntime/types/responses/input_item_param.py +++ b/src/arkruntime/types/responses/input_item_param.py @@ -22,10 +22,14 @@ from .item_function_tool_call_output_param import ItemFunctionToolCallOutputParam from .item_function_tool_call_param import ItemFunctionToolCallParam from .item_reasoning_param import ItemReasoningParam +from .item_tool_search_call_param import ItemToolSearchCallParam +from .item_tool_search_output_param import ItemToolSearchOutputParam InputItemParam: TypeAlias = Union[ ItemEasyMessageParam, ItemFunctionToolCallParam, + ItemToolSearchCallParam, + ItemToolSearchOutputParam, ItemFunctionToolCallOutputParam, ItemReasoningParam, ItemFunctionMcpApprovalRequestParam, diff --git a/src/arkruntime/types/responses/item_function_tool_call.py b/src/arkruntime/types/responses/item_function_tool_call.py index e5c38cd..fc64275 100644 --- a/src/arkruntime/types/responses/item_function_tool_call.py +++ b/src/arkruntime/types/responses/item_function_tool_call.py @@ -31,6 +31,10 @@ class ItemFunctionToolCall(BaseModel): """ The name of the function to call. """ + namespace: Optional[str] = None + """ + Namespace of the called function, omitted for top-level functions. + """ status: Optional[ItemStatus] = None """ The status of the item. diff --git a/src/arkruntime/types/responses/item_function_tool_call_output.py b/src/arkruntime/types/responses/item_function_tool_call_output.py index 4a94978..a51ceec 100644 --- a/src/arkruntime/types/responses/item_function_tool_call_output.py +++ b/src/arkruntime/types/responses/item_function_tool_call_output.py @@ -15,6 +15,10 @@ class ItemFunctionToolCallOutput(BaseModel): + namespace: Optional[str] = None + """ + Namespace of the function whose result is being supplied. + """ type: Literal["function_call_output"] call_id: Optional[str] = None output: Optional[MessageContent] = None diff --git a/src/arkruntime/types/responses/item_function_tool_call_output_param.py b/src/arkruntime/types/responses/item_function_tool_call_output_param.py index 9112e44..3d9f25f 100644 --- a/src/arkruntime/types/responses/item_function_tool_call_output_param.py +++ b/src/arkruntime/types/responses/item_function_tool_call_output_param.py @@ -15,6 +15,9 @@ class ItemFunctionToolCallOutputParam(TypedDict, total=False): + namespace: Optional[str] + """Namespace of the function whose result is being supplied.""" + type: Required[Literal["function_call_output"]] call_id: Optional[str] diff --git a/src/arkruntime/types/responses/item_function_tool_call_param.py b/src/arkruntime/types/responses/item_function_tool_call_param.py index f6f03df..8fc8797 100644 --- a/src/arkruntime/types/responses/item_function_tool_call_param.py +++ b/src/arkruntime/types/responses/item_function_tool_call_param.py @@ -28,5 +28,8 @@ class ItemFunctionToolCallParam(TypedDict, total=False): name: Optional[str] """The name of the function to call.""" + namespace: Optional[str] + """Namespace of the called function, omitted for top-level functions.""" + status: Optional[ItemStatus] """The status of the item.""" diff --git a/src/arkruntime/types/responses/item_tool_search_call.py b/src/arkruntime/types/responses/item_tool_search_call.py new file mode 100644 index 0000000..9a8f49e --- /dev/null +++ b/src/arkruntime/types/responses/item_tool_search_call.py @@ -0,0 +1,32 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict, Literal, Optional + +from arkruntime._models import BaseModel + +from .item_status import ItemStatus +from .tool_search_execution import ToolSearchExecution + + +class ItemToolSearchCall(BaseModel): + type: Literal["tool_search_call"] + id: Optional[str] = None + status: Optional[ItemStatus] = None + arguments: Dict[str, object] + """ + JSON object (not an encoded string). Completed calls contain a nonempty paths array; added streaming items initially contain {}. + """ + call_id: Optional[str] = None + """ + Hosted search emits null. Replayed hosted history must omit this field or set it to null. + """ + execution: Optional[ToolSearchExecution] = None + """ + Hosted search emits server. Omitted or empty execution defaults to server when replaying history. Client history is not supported. + """ diff --git a/src/arkruntime/types/responses/item_tool_search_call_param.py b/src/arkruntime/types/responses/item_tool_search_call_param.py new file mode 100644 index 0000000..65a62e8 --- /dev/null +++ b/src/arkruntime/types/responses/item_tool_search_call_param.py @@ -0,0 +1,31 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict, Literal, Optional + +from typing_extensions import Required, TypedDict + +from .item_status import ItemStatus +from .tool_search_execution import ToolSearchExecution + + +class ItemToolSearchCallParam(TypedDict, total=False): + type: Required[Literal["tool_search_call"]] + + id: Optional[str] + + status: Optional[ItemStatus] + + arguments: Required[Dict[str, object]] + """JSON object (not an encoded string). Completed calls contain a nonempty paths array; added streaming items initially contain {}.""" + + call_id: Optional[Optional[str]] + """Hosted search emits null. Replayed hosted history must omit this field or set it to null.""" + + execution: Optional[ToolSearchExecution] + """Hosted search emits server. Omitted or empty execution defaults to server when replaying history. Client history is not supported.""" diff --git a/src/arkruntime/types/responses/item_tool_search_output.py b/src/arkruntime/types/responses/item_tool_search_output.py new file mode 100644 index 0000000..f2b8f1a --- /dev/null +++ b/src/arkruntime/types/responses/item_tool_search_output.py @@ -0,0 +1,33 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Literal, Optional + +from arkruntime._models import BaseModel + +from .item_status import ItemStatus +from .tool_search_execution import ToolSearchExecution +from .tool_search_result_tool import ToolSearchResultTool + + +class ItemToolSearchOutput(BaseModel): + type: Literal["tool_search_output"] + id: Optional[str] = None + status: Optional[ItemStatus] = None + call_id: Optional[str] = None + """ + Hosted search emits null. Replayed hosted history must omit this field or set it to null. + """ + execution: Optional[ToolSearchExecution] = None + """ + Hosted search emits server; omitted or empty execution defaults to server on replay. + """ + tools: List[ToolSearchResultTool] + """ + Loaded definitions, including their complete parameter schemas. Replayed history requires a nonempty list following the corresponding search call. + """ diff --git a/src/arkruntime/types/responses/item_tool_search_output_param.py b/src/arkruntime/types/responses/item_tool_search_output_param.py new file mode 100644 index 0000000..3956260 --- /dev/null +++ b/src/arkruntime/types/responses/item_tool_search_output_param.py @@ -0,0 +1,32 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Literal, Optional + +from typing_extensions import Required, TypedDict + +from .item_status import ItemStatus +from .tool_search_execution import ToolSearchExecution +from .tool_search_result_tool_param import ToolSearchResultToolParam + + +class ItemToolSearchOutputParam(TypedDict, total=False): + type: Required[Literal["tool_search_output"]] + + id: Optional[str] + + status: Optional[ItemStatus] + + call_id: Optional[Optional[str]] + """Hosted search emits null. Replayed hosted history must omit this field or set it to null.""" + + execution: Optional[ToolSearchExecution] + """Hosted search emits server; omitted or empty execution defaults to server on replay.""" + + tools: Required[List[ToolSearchResultToolParam]] + """Loaded definitions, including their complete parameter schemas. Replayed history requires a nonempty list following the corresponding search call.""" diff --git a/src/arkruntime/types/responses/namespace_tool.py b/src/arkruntime/types/responses/namespace_tool.py new file mode 100644 index 0000000..b4ba476 --- /dev/null +++ b/src/arkruntime/types/responses/namespace_tool.py @@ -0,0 +1,26 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Literal, Optional + +from arkruntime._models import BaseModel + +from .function_tool import FunctionTool + + +class NamespaceTool(BaseModel): + type: Literal["namespace"] + name: str + """ + Namespace used to qualify function calls. + """ + description: Optional[str] = None + tools: List[FunctionTool] + """ + Functions in this namespace. Nested namespaces are not supported. + """ diff --git a/src/arkruntime/types/responses/namespace_tool_param.py b/src/arkruntime/types/responses/namespace_tool_param.py new file mode 100644 index 0000000..eba71e4 --- /dev/null +++ b/src/arkruntime/types/responses/namespace_tool_param.py @@ -0,0 +1,25 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Literal, Optional + +from typing_extensions import Required, TypedDict + +from .function_tool_param import FunctionToolParam + + +class NamespaceToolParam(TypedDict, total=False): + type: Required[Literal["namespace"]] + + name: Required[str] + """Namespace used to qualify function calls.""" + + description: Optional[str] + + tools: Required[List[FunctionToolParam]] + """Functions in this namespace. Nested namespaces are not supported.""" diff --git a/src/arkruntime/types/responses/output_item.py b/src/arkruntime/types/responses/output_item.py index 58ab4a3..4700e97 100644 --- a/src/arkruntime/types/responses/output_item.py +++ b/src/arkruntime/types/responses/output_item.py @@ -22,6 +22,8 @@ from .item_function_web_search import ItemFunctionWebSearch from .item_output_message import ItemOutputMessage from .item_reasoning import ItemReasoning +from .item_tool_search_call import ItemToolSearchCall +from .item_tool_search_output import ItemToolSearchOutput from .item_transcription import ItemTranscription OutputItem = TypeAliasType( @@ -30,6 +32,8 @@ Union[ ItemOutputMessage, ItemFunctionToolCall, + ItemToolSearchCall, + ItemToolSearchOutput, ItemReasoning, ItemTranscription, ItemFunctionWebSearch, diff --git a/src/arkruntime/types/responses/tool.py b/src/arkruntime/types/responses/tool.py index 5495bff..ad8048c 100644 --- a/src/arkruntime/types/responses/tool.py +++ b/src/arkruntime/types/responses/tool.py @@ -16,6 +16,8 @@ from .image_process_tool import ImageProcessTool from .knowledge_search_tool import KnowledgeSearchTool from .mcp_tool import McpTool +from .namespace_tool import NamespaceTool +from .tool_search_tool import ToolSearchTool from .web_search_tool import WebSearchTool Tool = TypeAliasType( @@ -23,6 +25,8 @@ Annotated[ Union[ FunctionTool, + NamespaceTool, + ToolSearchTool, WebSearchTool, ImageProcessTool, McpTool, diff --git a/src/arkruntime/types/responses/tool_param.py b/src/arkruntime/types/responses/tool_param.py index 202c22a..ac18c51 100644 --- a/src/arkruntime/types/responses/tool_param.py +++ b/src/arkruntime/types/responses/tool_param.py @@ -15,10 +15,14 @@ from .image_process_tool_param import ImageProcessToolParam from .knowledge_search_tool_param import KnowledgeSearchToolParam from .mcp_tool_param import McpToolParam +from .namespace_tool_param import NamespaceToolParam +from .tool_search_tool_param import ToolSearchToolParam from .web_search_tool_param import WebSearchToolParam ToolParam: TypeAlias = Union[ FunctionToolParam, + NamespaceToolParam, + ToolSearchToolParam, WebSearchToolParam, ImageProcessToolParam, McpToolParam, diff --git a/src/arkruntime/types/responses/tool_search_execution.py b/src/arkruntime/types/responses/tool_search_execution.py new file mode 100644 index 0000000..600d552 --- /dev/null +++ b/src/arkruntime/types/responses/tool_search_execution.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from enum import Enum + + +class ToolSearchExecution(str, Enum): + server = "server" + client = "client" + field_ = "" diff --git a/src/arkruntime/types/responses/tool_search_result_tool.py b/src/arkruntime/types/responses/tool_search_result_tool.py new file mode 100644 index 0000000..fda57e4 --- /dev/null +++ b/src/arkruntime/types/responses/tool_search_result_tool.py @@ -0,0 +1,23 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +from .function_tool import FunctionTool +from .namespace_tool import NamespaceTool + +ToolSearchResultTool = TypeAliasType( + "ToolSearchResultTool", + Annotated[Union[FunctionTool, NamespaceTool], Field(discriminator="type")], +) +""" +Full function or namespace definitions returned by hosted tool search. +""" diff --git a/src/arkruntime/types/responses/tool_search_result_tool_param.py b/src/arkruntime/types/responses/tool_search_result_tool_param.py new file mode 100644 index 0000000..2fe4197 --- /dev/null +++ b/src/arkruntime/types/responses/tool_search_result_tool_param.py @@ -0,0 +1,19 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from typing_extensions import TypeAlias + +from .function_tool_param import FunctionToolParam +from .namespace_tool_param import NamespaceToolParam + +ToolSearchResultToolParam: TypeAlias = Union[FunctionToolParam, NamespaceToolParam] +""" +Full function or namespace definitions returned by hosted tool search. +""" diff --git a/src/arkruntime/types/responses/tool_search_tool.py b/src/arkruntime/types/responses/tool_search_tool.py new file mode 100644 index 0000000..87e0934 --- /dev/null +++ b/src/arkruntime/types/responses/tool_search_tool.py @@ -0,0 +1,29 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict, Literal, Optional + +from arkruntime._models import BaseModel + +from .tool_search_execution import ToolSearchExecution + + +class ToolSearchTool(BaseModel): + type: Literal["tool_search"] + execution: Optional[ToolSearchExecution] = None + """ + Omitted, null or empty means server. Client execution uses full-schema fallback. + """ + description: Optional[str] = None + """ + Optional caller-supplied description; hosted search uses its built-in definition. + """ + parameters: Optional[Dict[str, object]] = None + """ + Optional JSON schema; hosted search uses its built-in parameter schema. + """ diff --git a/src/arkruntime/types/responses/tool_search_tool_param.py b/src/arkruntime/types/responses/tool_search_tool_param.py new file mode 100644 index 0000000..997df1e --- /dev/null +++ b/src/arkruntime/types/responses/tool_search_tool_param.py @@ -0,0 +1,26 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict, Literal, Optional + +from typing_extensions import Required, TypedDict + +from .tool_search_execution import ToolSearchExecution + + +class ToolSearchToolParam(TypedDict, total=False): + type: Required[Literal["tool_search"]] + + execution: Optional[Optional[ToolSearchExecution]] + """Omitted, null or empty means server. Client execution uses full-schema fallback.""" + + description: Optional[str] + """Optional caller-supplied description; hosted search uses its built-in definition.""" + + parameters: Optional[Dict[str, object]] + """Optional JSON schema; hosted search uses its built-in parameter schema.""" diff --git a/src/arkruntime/types/session/__init__.py b/src/arkruntime/types/session/__init__.py index e5dd02c..2770de0 100644 --- a/src/arkruntime/types/session/__init__.py +++ b/src/arkruntime/types/session/__init__.py @@ -11,6 +11,7 @@ from .agent_with_upgrades import AgentWithUpgrades from .base64_document_source import Base64DocumentSource from .base64_image_source import Base64ImageSource +from .base64_video_source import Base64VideoSource from .cache_creation import CacheCreation from .checkpoint_component import CheckpointComponent from .checkpoint_component_status import CheckpointComponentStatus @@ -33,6 +34,7 @@ from .environment_with_upgrades import EnvironmentWithUpgrades from .file_document_source import FileDocumentSource from .file_image_source import FileImageSource +from .file_video_source import FileVideoSource from .get_session_checkpoint_response import GetSessionCheckpointResponse from .image_source import ImageSource from .list_session_checkpoints_response import ListSessionCheckpointsResponse @@ -53,7 +55,13 @@ from .managed_agents_message_content_block import ManagedAgentsMessageContentBlock from .managed_agents_rubric import ManagedAgentsRubric from .managed_agents_search_result_block import ManagedAgentsSearchResultBlock +from .managed_agents_session_end_turn import ManagedAgentsSessionEndTurn from .managed_agents_session_event import ManagedAgentsSessionEvent +from .managed_agents_session_requires_action import ManagedAgentsSessionRequiresAction +from .managed_agents_session_retries_exhausted import ( + ManagedAgentsSessionRetriesExhausted, +) +from .managed_agents_session_stop_reason import ManagedAgentsSessionStopReason from .managed_agents_start_event import ManagedAgentsStartEvent from .managed_agents_start_event_preview import ManagedAgentsStartEventPreview from .managed_agents_stream_preview_event import ManagedAgentsStreamPreviewEvent @@ -84,6 +92,7 @@ from .managed_agents_user_tool_result_event_params import ( ManagedAgentsUserToolResultEventParams, ) +from .managed_agents_video_block import ManagedAgentsVideoBlock from .model_overrides import ModelOverrides from .model_upgrades import ModelUpgrades from .override_token_limits import OverrideTokenLimits @@ -106,6 +115,8 @@ from .update_session_request import UpdateSessionRequest from .url_document_source import UrlDocumentSource from .url_image_source import UrlImageSource +from .url_video_source import UrlVideoSource +from .video_source import VideoSource __all__ = [ "AgentIdentifier", @@ -113,6 +124,7 @@ "AgentWithUpgrades", "Base64DocumentSource", "Base64ImageSource", + "Base64VideoSource", "CacheCreation", "CheckpointComponent", "CheckpointComponentStatus", @@ -135,6 +147,7 @@ "EnvironmentWithUpgrades", "FileDocumentSource", "FileImageSource", + "FileVideoSource", "GetSessionCheckpointResponse", "ImageSource", "ListSessionCheckpointsResponse", @@ -155,7 +168,11 @@ "ManagedAgentsMessageContentBlock", "ManagedAgentsRubric", "ManagedAgentsSearchResultBlock", + "ManagedAgentsSessionEndTurn", "ManagedAgentsSessionEvent", + "ManagedAgentsSessionRequiresAction", + "ManagedAgentsSessionRetriesExhausted", + "ManagedAgentsSessionStopReason", "ManagedAgentsStartEvent", "ManagedAgentsStartEventPreview", "ManagedAgentsStreamPreviewEvent", @@ -170,6 +187,7 @@ "ManagedAgentsUserMessageEventParams", "ManagedAgentsUserToolConfirmationEventParams", "ManagedAgentsUserToolResultEventParams", + "ManagedAgentsVideoBlock", "ModelOverrides", "ModelUpgrades", "OverrideTokenLimits", @@ -192,6 +210,8 @@ "UpdateSessionRequest", "UrlDocumentSource", "UrlImageSource", + "UrlVideoSource", + "VideoSource", ] # Hand-written extras (preserved across regen via Makefile rsync --exclude=*_shim.py). diff --git a/src/arkruntime/types/session/base64_document_source.py b/src/arkruntime/types/session/base64_document_source.py index 7509d12..6ea82a6 100644 --- a/src/arkruntime/types/session/base64_document_source.py +++ b/src/arkruntime/types/session/base64_document_source.py @@ -16,6 +16,7 @@ class Base64DocumentSource(BaseModel): 直接以 base64 携带的文档数据。 """ + type: Literal["base64"] data: str """ base64 文档数据。 @@ -24,4 +25,3 @@ class Base64DocumentSource(BaseModel): """ MIME 类型,如 `application/pdf`。 """ - type: Literal["base64"] diff --git a/src/arkruntime/types/session/base64_image_source.py b/src/arkruntime/types/session/base64_image_source.py index 150c670..df7a4f8 100644 --- a/src/arkruntime/types/session/base64_image_source.py +++ b/src/arkruntime/types/session/base64_image_source.py @@ -16,6 +16,7 @@ class Base64ImageSource(BaseModel): 直接以 base64 携带的图片数据。 """ + type: Literal["base64"] data: str """ base64 图片数据。 @@ -24,4 +25,3 @@ class Base64ImageSource(BaseModel): """ MIME 类型,如 `image/png` / `image/jpeg`。 """ - type: Literal["base64"] diff --git a/src/arkruntime/types/session/base64_video_source.py b/src/arkruntime/types/session/base64_video_source.py new file mode 100644 index 0000000..658c031 --- /dev/null +++ b/src/arkruntime/types/session/base64_video_source.py @@ -0,0 +1,31 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + + +class Base64VideoSource(BaseModel): + """ + 直接以 base64 携带的视频。 + """ + + type: Literal["base64"] + data: str + """ + Base64 编码的视频数据。 + """ + media_type: str + """ + 视频 MIME 类型:`video/mp4` / `video/x-msvideo` / `video/quicktime`。 + """ + fps: Optional[float] = None + """ + 视频抽帧帧率;省略时由下游模型默认策略决定。 + """ diff --git a/src/arkruntime/types/session/file_document_source.py b/src/arkruntime/types/session/file_document_source.py index 28f506c..9688d21 100644 --- a/src/arkruntime/types/session/file_document_source.py +++ b/src/arkruntime/types/session/file_document_source.py @@ -16,8 +16,8 @@ class FileDocumentSource(BaseModel): 通过 Files API 上传后引用的文档。 """ + type: Literal["file"] file_id: str """ file id,形如 `file_...`。 """ - type: Literal["file"] diff --git a/src/arkruntime/types/session/file_image_source.py b/src/arkruntime/types/session/file_image_source.py index 4edd6a0..42ac1dd 100644 --- a/src/arkruntime/types/session/file_image_source.py +++ b/src/arkruntime/types/session/file_image_source.py @@ -16,8 +16,8 @@ class FileImageSource(BaseModel): 通过 Files API 上传后引用的图片。 """ + type: Literal["file"] file_id: str """ file id,形如 `file_...`。 """ - type: Literal["file"] diff --git a/src/arkruntime/types/session/file_video_source.py b/src/arkruntime/types/session/file_video_source.py new file mode 100644 index 0000000..664012b --- /dev/null +++ b/src/arkruntime/types/session/file_video_source.py @@ -0,0 +1,27 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + + +class FileVideoSource(BaseModel): + """ + 通过 Files API 上传后引用的视频。 + """ + + type: Literal["file"] + file_id: str + """ + 已上传的视频 file id。 + """ + fps: Optional[float] = None + """ + 视频抽帧帧率;file 改写为 URL 时透传此值。 + """ diff --git a/src/arkruntime/types/session/managed_agents_document_block.py b/src/arkruntime/types/session/managed_agents_document_block.py index c7d00cd..c287a67 100644 --- a/src/arkruntime/types/session/managed_agents_document_block.py +++ b/src/arkruntime/types/session/managed_agents_document_block.py @@ -18,6 +18,7 @@ class ManagedAgentsDocumentBlock(BaseModel): 文档块。 """ + type: Literal["document"] source: DocumentSource """ 文档来源。 @@ -30,4 +31,3 @@ class ManagedAgentsDocumentBlock(BaseModel): """ 上下文说明。 """ - type: Literal["document"] diff --git a/src/arkruntime/types/session/managed_agents_image_block.py b/src/arkruntime/types/session/managed_agents_image_block.py index b5e2641..62ecd1d 100644 --- a/src/arkruntime/types/session/managed_agents_image_block.py +++ b/src/arkruntime/types/session/managed_agents_image_block.py @@ -18,8 +18,8 @@ class ManagedAgentsImageBlock(BaseModel): 图片块。 """ + type: Literal["image"] source: ImageSource """ 图片来源。 """ - type: Literal["image"] diff --git a/src/arkruntime/types/session/managed_agents_message_content_block.py b/src/arkruntime/types/session/managed_agents_message_content_block.py index b078866..cb5c2f0 100644 --- a/src/arkruntime/types/session/managed_agents_message_content_block.py +++ b/src/arkruntime/types/session/managed_agents_message_content_block.py @@ -14,17 +14,21 @@ from .managed_agents_document_block import ManagedAgentsDocumentBlock from .managed_agents_image_block import ManagedAgentsImageBlock from .managed_agents_text_block import ManagedAgentsTextBlock +from .managed_agents_video_block import ManagedAgentsVideoBlock ManagedAgentsMessageContentBlock = TypeAliasType( "ManagedAgentsMessageContentBlock", Annotated[ Union[ - ManagedAgentsTextBlock, ManagedAgentsImageBlock, ManagedAgentsDocumentBlock + ManagedAgentsTextBlock, + ManagedAgentsImageBlock, + ManagedAgentsDocumentBlock, + ManagedAgentsVideoBlock, ], Field(discriminator="type"), ], ) """ `user.message` 的 content 列表元素 tagged union(discriminator = `type`)。 -支持 3 种模态:`text` / `image` / `document`。 +支持 4 种模态:`text` / `image` / `document` / `video`。 """ diff --git a/src/arkruntime/types/session/managed_agents_search_result_block.py b/src/arkruntime/types/session/managed_agents_search_result_block.py index 27a9897..d8c6543 100644 --- a/src/arkruntime/types/session/managed_agents_search_result_block.py +++ b/src/arkruntime/types/session/managed_agents_search_result_block.py @@ -19,6 +19,7 @@ class ManagedAgentsSearchResultBlock(BaseModel): 搜索结果块——多个 SearchResultContent 文本片段 + 元信息。 """ + type: Literal["search_result"] citations: SearchResultCitations """ citation 控制。 @@ -35,4 +36,3 @@ class ManagedAgentsSearchResultBlock(BaseModel): """ 结果标题。 """ - type: Literal["search_result"] diff --git a/src/arkruntime/types/session/managed_agents_session_end_turn.py b/src/arkruntime/types/session/managed_agents_session_end_turn.py new file mode 100644 index 0000000..f4bb9f5 --- /dev/null +++ b/src/arkruntime/types/session/managed_agents_session_end_turn.py @@ -0,0 +1,19 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal + +from arkruntime._models import BaseModel + + +class ManagedAgentsSessionEndTurn(BaseModel): + """ + Agent 自然完成本轮,准备接收下一条用户消息。 + """ + + type: Literal["end_turn"] diff --git a/src/arkruntime/types/session/managed_agents_session_event.py b/src/arkruntime/types/session/managed_agents_session_event.py index 58ee7d3..82dad61 100644 --- a/src/arkruntime/types/session/managed_agents_session_event.py +++ b/src/arkruntime/types/session/managed_agents_session_event.py @@ -10,6 +10,8 @@ from arkruntime._models import BaseModel +from .managed_agents_session_stop_reason import ManagedAgentsSessionStopReason + class ManagedAgentsSessionEvent(BaseModel): """ @@ -32,3 +34,7 @@ class ManagedAgentsSessionEvent(BaseModel): """ 事件产生时间(RFC 3339)。 """ + stop_reason: Optional[ManagedAgentsSessionStopReason] = None + """ + `session.status_idle` / `session.thread_status_idle` 的停止原因。 + """ diff --git a/src/arkruntime/types/session/managed_agents_session_requires_action.py b/src/arkruntime/types/session/managed_agents_session_requires_action.py new file mode 100644 index 0000000..35a9494 --- /dev/null +++ b/src/arkruntime/types/session/managed_agents_session_requires_action.py @@ -0,0 +1,23 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Literal + +from arkruntime._models import BaseModel + + +class ManagedAgentsSessionRequiresAction(BaseModel): + """ + Agent 正等待一个或多个阻塞性的用户输入事件。 + """ + + type: Literal["requires_action"] + event_ids: List[str] + """ + 等待处理的事件 id;部分解决后,idle 事件以剩余 id 重新发出。 + """ diff --git a/src/arkruntime/types/session/managed_agents_session_retries_exhausted.py b/src/arkruntime/types/session/managed_agents_session_retries_exhausted.py new file mode 100644 index 0000000..6d58376 --- /dev/null +++ b/src/arkruntime/types/session/managed_agents_session_retries_exhausted.py @@ -0,0 +1,19 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal + +from arkruntime._models import BaseModel + + +class ManagedAgentsSessionRetriesExhausted(BaseModel): + """ + 重试预算用尽导致本轮终止。 + """ + + type: Literal["retries_exhausted"] diff --git a/src/arkruntime/types/session/managed_agents_session_stop_reason.py b/src/arkruntime/types/session/managed_agents_session_stop_reason.py new file mode 100644 index 0000000..8b73619 --- /dev/null +++ b/src/arkruntime/types/session/managed_agents_session_stop_reason.py @@ -0,0 +1,33 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +from .managed_agents_session_end_turn import ManagedAgentsSessionEndTurn +from .managed_agents_session_requires_action import ManagedAgentsSessionRequiresAction +from .managed_agents_session_retries_exhausted import ( + ManagedAgentsSessionRetriesExhausted, +) + +ManagedAgentsSessionStopReason = TypeAliasType( + "ManagedAgentsSessionStopReason", + Annotated[ + Union[ + ManagedAgentsSessionEndTurn, + ManagedAgentsSessionRequiresAction, + ManagedAgentsSessionRetriesExhausted, + ], + Field(discriminator="type"), + ], +) +""" +Session / thread 进入 idle 的原因;仅 requires_action 携带 event_ids。 +""" diff --git a/src/arkruntime/types/session/managed_agents_text_block.py b/src/arkruntime/types/session/managed_agents_text_block.py index f11753f..ff2cf2b 100644 --- a/src/arkruntime/types/session/managed_agents_text_block.py +++ b/src/arkruntime/types/session/managed_agents_text_block.py @@ -16,8 +16,8 @@ class ManagedAgentsTextBlock(BaseModel): 文本块。用于 user.message / tool_result / system.message 的 content 列表。 """ + type: Literal["text"] text: str """ 文本内容。 """ - type: Literal["text"] diff --git a/src/arkruntime/types/session/managed_agents_tool_result_content_block.py b/src/arkruntime/types/session/managed_agents_tool_result_content_block.py index bb3e4e5..f1daab6 100644 --- a/src/arkruntime/types/session/managed_agents_tool_result_content_block.py +++ b/src/arkruntime/types/session/managed_agents_tool_result_content_block.py @@ -15,6 +15,7 @@ from .managed_agents_image_block import ManagedAgentsImageBlock from .managed_agents_search_result_block import ManagedAgentsSearchResultBlock from .managed_agents_text_block import ManagedAgentsTextBlock +from .managed_agents_video_block import ManagedAgentsVideoBlock ManagedAgentsToolResultContentBlock = TypeAliasType( "ManagedAgentsToolResultContentBlock", @@ -24,11 +25,12 @@ ManagedAgentsImageBlock, ManagedAgentsDocumentBlock, ManagedAgentsSearchResultBlock, + ManagedAgentsVideoBlock, ], Field(discriminator="type"), ], ) """ `user.tool_result.content` / `user.custom_tool_result.content` 允许的 block -类型 tagged union:`text` / `image` / `document` / `search_result`。 +类型 tagged union:`text` / `image` / `document` / `search_result` / `video`。 """ diff --git a/src/arkruntime/types/session/managed_agents_user_message_event_params.py b/src/arkruntime/types/session/managed_agents_user_message_event_params.py index d96e5b5..779c826 100644 --- a/src/arkruntime/types/session/managed_agents_user_message_event_params.py +++ b/src/arkruntime/types/session/managed_agents_user_message_event_params.py @@ -25,7 +25,7 @@ class ManagedAgentsUserMessageEventParams(BaseModel): content: Optional[List[ManagedAgentsMessageContentBlock]] = None """ - 消息 content:多模态 block 列表(text / image / document)。 + 消息 content:多模态 block 列表(text / image / document / video)。 """ session_id: Optional[str] = None """ diff --git a/src/arkruntime/types/session/managed_agents_video_block.py b/src/arkruntime/types/session/managed_agents_video_block.py new file mode 100644 index 0000000..658a658 --- /dev/null +++ b/src/arkruntime/types/session/managed_agents_video_block.py @@ -0,0 +1,25 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal + +from arkruntime._models import BaseModel + +from .video_source import VideoSource + + +class ManagedAgentsVideoBlock(BaseModel): + """ + 视频块;支持 base64 / URL / file 来源。 + """ + + type: Literal["video"] + source: VideoSource + """ + 视频来源。 + """ diff --git a/src/arkruntime/types/session/plain_text_document_source.py b/src/arkruntime/types/session/plain_text_document_source.py index 2fbefff..6f79143 100644 --- a/src/arkruntime/types/session/plain_text_document_source.py +++ b/src/arkruntime/types/session/plain_text_document_source.py @@ -16,6 +16,7 @@ class PlainTextDocumentSource(BaseModel): 纯文本文档;`media_type` 必须为 `text/plain`;`data` 是原文。 """ + type: Literal["text"] data: str """ 文档原文。 @@ -24,4 +25,3 @@ class PlainTextDocumentSource(BaseModel): """ MIME 类型,固定 `text/plain`。 """ - type: Literal["text"] diff --git a/src/arkruntime/types/session/search_result_content.py b/src/arkruntime/types/session/search_result_content.py index 1403e08..8aa57b9 100644 --- a/src/arkruntime/types/session/search_result_content.py +++ b/src/arkruntime/types/session/search_result_content.py @@ -6,6 +6,8 @@ from __future__ import annotations +from typing import Literal + from arkruntime._models import BaseModel @@ -14,6 +16,7 @@ class SearchResultContent(BaseModel): 搜索结果内的纯文本片段。 """ + type: Literal["text"] text: str """ 文本内容。 diff --git a/src/arkruntime/types/session/url_document_source.py b/src/arkruntime/types/session/url_document_source.py index 65386bc..97849cc 100644 --- a/src/arkruntime/types/session/url_document_source.py +++ b/src/arkruntime/types/session/url_document_source.py @@ -16,8 +16,8 @@ class UrlDocumentSource(BaseModel): 通过 URL 引用的文档。 """ + type: Literal["url"] url: str """ 文档 URL。 """ - type: Literal["url"] diff --git a/src/arkruntime/types/session/url_image_source.py b/src/arkruntime/types/session/url_image_source.py index f775467..e4fac14 100644 --- a/src/arkruntime/types/session/url_image_source.py +++ b/src/arkruntime/types/session/url_image_source.py @@ -16,8 +16,8 @@ class UrlImageSource(BaseModel): 通过 URL 引用的图片。 """ + type: Literal["url"] url: str """ 图片 URL。 """ - type: Literal["url"] diff --git a/src/arkruntime/types/session/url_video_source.py b/src/arkruntime/types/session/url_video_source.py new file mode 100644 index 0000000..49e80d7 --- /dev/null +++ b/src/arkruntime/types/session/url_video_source.py @@ -0,0 +1,27 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + + +class UrlVideoSource(BaseModel): + """ + 通过 URL 引用的视频。 + """ + + type: Literal["url"] + url: str + """ + 视频 URL。 + """ + fps: Optional[float] = None + """ + 视频抽帧帧率;省略时由下游模型默认策略决定。 + """ diff --git a/src/arkruntime/types/session/video_source.py b/src/arkruntime/types/session/video_source.py new file mode 100644 index 0000000..6d1bd12 --- /dev/null +++ b/src/arkruntime/types/session/video_source.py @@ -0,0 +1,27 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +from .base64_video_source import Base64VideoSource +from .file_video_source import FileVideoSource +from .url_video_source import UrlVideoSource + +VideoSource = TypeAliasType( + "VideoSource", + Annotated[ + Union[Base64VideoSource, UrlVideoSource, FileVideoSource], + Field(discriminator="type"), + ], +) +""" +视频来源 tagged union:`base64` / `url` / `file`。 +""" diff --git a/src/arkruntime/types/systemone/__init__.py b/src/arkruntime/types/systemone/__init__.py new file mode 100644 index 0000000..1e9682e --- /dev/null +++ b/src/arkruntime/types/systemone/__init__.py @@ -0,0 +1,121 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from .answer import Answer +from .audio_content import AudioContent +from .choice_answer import ChoiceAnswer +from .choice_criteria import ChoiceCriteria +from .choice_description import ChoiceDescription +from .choice_question import ChoiceQuestion +from .error_detail import ErrorDetail +from .error_response import ErrorResponse +from .forbidden_response import ForbiddenResponse +from .image_content import ImageContent +from .image_detail import ImageDetail +from .image_pixel_limit import ImagePixelLimit +from .instructions import Instructions +from .json_object import JSONObject +from .media_file_id import MediaFileID +from .media_source import MediaSource +from .model_id import ModelID +from .noul_answer import NoulAnswer +from .noul_criteria import NoulCriteria +from .noul_question import NoulQuestion +from .nullable_instructions import NullableInstructions +from .positive_pixels import PositivePixels +from .probability import Probability +from .question import Question +from .questions import Questions +from .score_answer import ScoreAnswer +from .score_criteria import ScoreCriteria +from .score_question import ScoreQuestion +from .score_value import ScoreValue +from .state import State +from .state_content import StateContent +from .state_objects import StateObjects +from .system_one_request import SystemOneRequest +from .system_one_response import SystemOneResponse +from .text_content import TextContent +from .text_value import TextValue +from .token_count import TokenCount +from .usage import Usage +from .video_content import VideoContent +from .video_fps import VideoFPS + +__all__ = [ + "Answer", + "AudioContent", + "ChoiceAnswer", + "ChoiceCriteria", + "ChoiceDescription", + "ChoiceQuestion", + "ErrorDetail", + "ErrorResponse", + "ForbiddenResponse", + "ImageContent", + "ImageDetail", + "ImagePixelLimit", + "Instructions", + "JSONObject", + "MediaFileID", + "MediaSource", + "ModelID", + "NoulAnswer", + "NoulCriteria", + "NoulQuestion", + "NullableInstructions", + "PositivePixels", + "Probability", + "Question", + "Questions", + "ScoreAnswer", + "ScoreCriteria", + "ScoreQuestion", + "ScoreValue", + "State", + "StateContent", + "StateObjects", + "SystemOneRequest", + "SystemOneResponse", + "TextContent", + "TextValue", + "TokenCount", + "Usage", + "VideoContent", + "VideoFPS", +] +from .audio_content_param import AudioContentParam +from .choice_criteria_param import ChoiceCriteriaParam +from .choice_description_param import ChoiceDescriptionParam +from .choice_question_param import ChoiceQuestionParam +from .image_content_param import ImageContentParam +from .image_pixel_limit_param import ImagePixelLimitParam +from .instructions_param import InstructionsParam +from .json_object_param import JSONObjectParam +from .media_file_id_param import MediaFileIDParam +from .media_source_param import MediaSourceParam +from .model_id_param import ModelIDParam +from .noul_criteria_param import NoulCriteriaParam +from .noul_question_param import NoulQuestionParam +from .nullable_instructions_param import NullableInstructionsParam +from .positive_pixels_param import PositivePixelsParam +from .question_param import QuestionParam +from .questions_param import QuestionsParam +from .score_criteria_param import ScoreCriteriaParam +from .score_question_param import ScoreQuestionParam +from .state_content_param import StateContentParam +from .state_objects_param import StateObjectsParam +from .state_param import StateParam +from .system_one_request_param import SystemOneRequestParam +from .text_content_param import TextContentParam +from .text_value_param import TextValueParam +from .video_content_param import VideoContentParam +from .video_fps_param import VideoFPSParam + +# Hand-written extras (preserved across regen via Makefile rsync --exclude=*_shim.py). +from ._init_extras_shim import * # noqa: F401,F403 diff --git a/src/arkruntime/types/systemone/_init_extras_shim.py b/src/arkruntime/types/systemone/_init_extras_shim.py new file mode 100644 index 0000000..bc2c795 --- /dev/null +++ b/src/arkruntime/types/systemone/_init_extras_shim.py @@ -0,0 +1,12 @@ +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +"""Hand-written extras shim for the systemone API (empty stub). + +Preserved across regen via the Makefile rsync --exclude=*_shim.py rule. +Add re-exports here as needed. +""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/src/arkruntime/types/systemone/answer.py b/src/arkruntime/types/systemone/answer.py new file mode 100644 index 0000000..fdaaaba --- /dev/null +++ b/src/arkruntime/types/systemone/answer.py @@ -0,0 +1,26 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +from .choice_answer import ChoiceAnswer +from .noul_answer import NoulAnswer +from .score_answer import ScoreAnswer + +Answer = TypeAliasType( + "Answer", + Annotated[ + Union[NoulAnswer, ChoiceAnswer, ScoreAnswer], Field(discriminator="type") + ], +) +""" +Answer variant matching the corresponding question type. +""" diff --git a/src/arkruntime/types/systemone/audio_content.py b/src/arkruntime/types/systemone/audio_content.py new file mode 100644 index 0000000..7bc006b --- /dev/null +++ b/src/arkruntime/types/systemone/audio_content.py @@ -0,0 +1,33 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + +from .media_file_id import MediaFileID +from .media_source import MediaSource + + +class AudioContent(BaseModel): + """ + Audio, supplied by exactly one of audio_url or file_id. Audio is evaluated as audio input; the response does not include a transcription. + """ + + type: Literal["audio"] + """ + Content type; always audio. + """ + audio_url: Optional[MediaSource] = None + """ + Public HTTP(S) URL or data:audio/;base64,. Mutually exclusive with file_id. + """ + file_id: Optional[MediaFileID] = None + """ + Active audio file ID from the Files API. Mutually exclusive with audio_url. + """ diff --git a/src/arkruntime/types/systemone/audio_content_param.py b/src/arkruntime/types/systemone/audio_content_param.py new file mode 100644 index 0000000..43d3ab7 --- /dev/null +++ b/src/arkruntime/types/systemone/audio_content_param.py @@ -0,0 +1,29 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from typing_extensions import Required, TypedDict + +from .media_file_id_param import MediaFileIDParam +from .media_source_param import MediaSourceParam + + +class AudioContentParam(TypedDict, total=False): + """ + Audio, supplied by exactly one of audio_url or file_id. Audio is evaluated as audio input; the response does not include a transcription. + """ + + type: Required[Literal["audio"]] + """Content type; always audio.""" + + audio_url: Optional[MediaSourceParam] + """Public HTTP(S) URL or data:audio/;base64,. Mutually exclusive with file_id.""" + + file_id: Optional[MediaFileIDParam] + """Active audio file ID from the Files API. Mutually exclusive with audio_url.""" diff --git a/src/arkruntime/types/systemone/choice_answer.py b/src/arkruntime/types/systemone/choice_answer.py new file mode 100644 index 0000000..0bdb131 --- /dev/null +++ b/src/arkruntime/types/systemone/choice_answer.py @@ -0,0 +1,36 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict, Literal + +from arkruntime._models import BaseModel + +from .probability import Probability + + +class ChoiceAnswer(BaseModel): + """ + Most likely choice and the probability of every supplied option. + """ + + type: Literal["choice"] + """ + Answer type; matches the question type. + """ + choice: str + """ + An option with the maximum probability, using the original criteria key. + """ + probabilities: Dict[str, Probability] + """ + Every option, including zero probabilities; values sum to 1 within floating-point tolerance. + """ + confidence: Probability + """ + Confidence in the classification, from 0 to 1 inclusive. It is distinct from an individual option probability; its calculation depends on the model. + """ diff --git a/src/arkruntime/types/systemone/choice_criteria.py b/src/arkruntime/types/systemone/choice_criteria.py new file mode 100644 index 0000000..98480da --- /dev/null +++ b/src/arkruntime/types/systemone/choice_criteria.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict + +from typing_extensions import TypeAliasType + +from .choice_description import ChoiceDescription + +ChoiceCriteria = TypeAliasType("ChoiceCriteria", Dict[str, ChoiceDescription]) +""" +Map from option names to descriptions. Each question accepts 1-255 options, inclusive; a single option is valid and an empty object is invalid. Option names, including empty or whitespace names, are passed through unchanged and take part in evaluation. The service preserves the option order it receives; JSON map serialization in an SDK may determine that order. Use distinct, mutually exclusive options and add an explicit fallback option when needed. Duplicate JSON keys use the last value; send unique names to avoid ambiguity. +""" diff --git a/src/arkruntime/types/systemone/choice_criteria_param.py b/src/arkruntime/types/systemone/choice_criteria_param.py new file mode 100644 index 0000000..fb6325b --- /dev/null +++ b/src/arkruntime/types/systemone/choice_criteria_param.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict + +from typing_extensions import TypeAlias + +from .choice_description_param import ChoiceDescriptionParam + +ChoiceCriteriaParam: TypeAlias = Dict[str, ChoiceDescriptionParam] +""" +Map from option names to descriptions. Each question accepts 1-255 options, inclusive; a single option is valid and an empty object is invalid. Option names, including empty or whitespace names, are passed through unchanged and take part in evaluation. The service preserves the option order it receives; JSON map serialization in an SDK may determine that order. Use distinct, mutually exclusive options and add an explicit fallback option when needed. Duplicate JSON keys use the last value; send unique names to avoid ambiguity. +""" diff --git a/src/arkruntime/types/systemone/choice_description.py b/src/arkruntime/types/systemone/choice_description.py new file mode 100644 index 0000000..960b038 --- /dev/null +++ b/src/arkruntime/types/systemone/choice_description.py @@ -0,0 +1,20 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Optional, Union + +from typing_extensions import TypeAliasType + +from .json_object import JSONObject + +ChoiceDescription = TypeAliasType( + "ChoiceDescription", Optional[Union[str, JSONObject, List[object]]] +) +""" +Description of one choice option. Explicit null means that the option has no additional description. +""" diff --git a/src/arkruntime/types/systemone/choice_description_param.py b/src/arkruntime/types/systemone/choice_description_param.py new file mode 100644 index 0000000..629831e --- /dev/null +++ b/src/arkruntime/types/systemone/choice_description_param.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Optional, Union + +from typing_extensions import TypeAlias + +from .json_object_param import JSONObjectParam + +ChoiceDescriptionParam: TypeAlias = Optional[Union[str, JSONObjectParam, List[object]]] +""" +Description of one choice option. Explicit null means that the option has no additional description. +""" diff --git a/src/arkruntime/types/systemone/choice_question.py b/src/arkruntime/types/systemone/choice_question.py new file mode 100644 index 0000000..3210dc3 --- /dev/null +++ b/src/arkruntime/types/systemone/choice_question.py @@ -0,0 +1,33 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + +from .choice_criteria import ChoiceCriteria +from .nullable_instructions import NullableInstructions + + +class ChoiceQuestion(BaseModel): + """ + A classification question. The answer selects one of the supplied criteria keys. + """ + + type: Literal["choice"] + """ + Question type. Use choice to select the most likely option. + """ + instructions: Optional[NullableInstructions] = None + """ + Optional evaluation instructions. Omitted or null uses the model's defaults; does not inherit instructions from other questions. + """ + criteria: ChoiceCriteria + """ + Candidate options and descriptions. Required; 1-255 options per question, inclusive. + """ diff --git a/src/arkruntime/types/systemone/choice_question_param.py b/src/arkruntime/types/systemone/choice_question_param.py new file mode 100644 index 0000000..0eec070 --- /dev/null +++ b/src/arkruntime/types/systemone/choice_question_param.py @@ -0,0 +1,29 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from typing_extensions import Required, TypedDict + +from .choice_criteria_param import ChoiceCriteriaParam +from .nullable_instructions_param import NullableInstructionsParam + + +class ChoiceQuestionParam(TypedDict, total=False): + """ + A classification question. The answer selects one of the supplied criteria keys. + """ + + type: Required[Literal["choice"]] + """Question type. Use choice to select the most likely option.""" + + instructions: Optional[NullableInstructionsParam] + """Optional evaluation instructions. Omitted or null uses the model's defaults; does not inherit instructions from other questions.""" + + criteria: Required[ChoiceCriteriaParam] + """Candidate options and descriptions. Required; 1-255 options per question, inclusive.""" diff --git a/src/arkruntime/types/systemone/error_detail.py b/src/arkruntime/types/systemone/error_detail.py new file mode 100644 index 0000000..6495dbd --- /dev/null +++ b/src/arkruntime/types/systemone/error_detail.py @@ -0,0 +1,32 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from arkruntime._models import BaseModel + + +class ErrorDetail(BaseModel): + """ + Public error details. Use code for programmatic handling; message can change. + """ + + code: str + """ + Stable error code, such as InvalidParameter, AuthenticationError or ServerOverloaded. + """ + message: str + """ + Human-readable cause and, when available, the request ID. Size and length errors identify the exceeded limit and its value. Do not parse this string for business logic. + """ + param: str + """ + Invalid parameter path, such as questions["q"].criteria or state[0].image_url. "body format" denotes invalid JSON syntax; body denotes an invalid overall request structure or an aggregate request/text limit; Content-Type denotes an invalid request media type. May be empty for errors not associated with a field or errors returned before parameter validation. + """ + type: str + """ + Error category, such as BadRequest, Unauthorized or ServiceUnavailable. Prefer code when handling errors. + """ diff --git a/src/arkruntime/types/systemone/error_response.py b/src/arkruntime/types/systemone/error_response.py new file mode 100644 index 0000000..4b36d60 --- /dev/null +++ b/src/arkruntime/types/systemone/error_response.py @@ -0,0 +1,22 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from arkruntime._models import BaseModel + +from .error_detail import ErrorDetail + + +class ErrorResponse(BaseModel): + """ + Standard JSON error envelope. Save the response X-Request-Id header when reporting a failure. + """ + + error: ErrorDetail + """ + Error code, description and parameter location. + """ diff --git a/src/arkruntime/types/systemone/forbidden_response.py b/src/arkruntime/types/systemone/forbidden_response.py new file mode 100644 index 0000000..37bcf7b --- /dev/null +++ b/src/arkruntime/types/systemone/forbidden_response.py @@ -0,0 +1,32 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Optional + +from arkruntime._models import BaseModel + +from .error_detail import ErrorDetail + + +class ForbiddenResponse(BaseModel): + """ + Access restrictions normally use the standard error object, including at the API entry. Some entry routes instead return the legacy error_code/error_msg envelope. The two envelopes are mutually exclusive; the envelope alone does not identify which component denied access. + """ + + error: Optional[ErrorDetail] = None + """ + Standard access-denial error. If present, error_code and error_msg are absent. + """ + error_code: Optional[str] = None + """ + Gateway error code, normally AccessDenied. Required with error_msg when error is absent. + """ + error_msg: Optional[str] = None + """ + Gateway access-denial message, potentially including RequestId. Required with error_code when error is absent. + """ diff --git a/src/arkruntime/types/systemone/image_content.py b/src/arkruntime/types/systemone/image_content.py new file mode 100644 index 0000000..2b20efc --- /dev/null +++ b/src/arkruntime/types/systemone/image_content.py @@ -0,0 +1,43 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + +from .image_detail import ImageDetail +from .image_pixel_limit import ImagePixelLimit +from .media_file_id import MediaFileID +from .media_source import MediaSource + + +class ImageContent(BaseModel): + """ + An image, supplied by exactly one of image_url or file_id. Missing or conflicting sources return 400. + """ + + type: Literal["image"] + """ + Content type; always image. + """ + image_url: Optional[MediaSource] = None + """ + Public HTTP(S) URL or data:image/;base64,. Mutually exclusive with file_id. + """ + file_id: Optional[MediaFileID] = None + """ + Active image file ID from the Files API. Mutually exclusive with image_url. + """ + detail: Optional[ImageDetail] = None + """ + Analysis detail: low or high. Omitted means high. image_pixel_limit takes precedence when supplied, but does not make an unsupported detail valid. + """ + image_pixel_limit: Optional[ImagePixelLimit] = None + """ + Optional resolution hints for this image. Model input size, dimensions, aspect ratio and format limits still apply. + """ diff --git a/src/arkruntime/types/systemone/image_content_param.py b/src/arkruntime/types/systemone/image_content_param.py new file mode 100644 index 0000000..1a6684f --- /dev/null +++ b/src/arkruntime/types/systemone/image_content_param.py @@ -0,0 +1,37 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from typing_extensions import Required, TypedDict + +from .image_detail import ImageDetail +from .image_pixel_limit_param import ImagePixelLimitParam +from .media_file_id_param import MediaFileIDParam +from .media_source_param import MediaSourceParam + + +class ImageContentParam(TypedDict, total=False): + """ + An image, supplied by exactly one of image_url or file_id. Missing or conflicting sources return 400. + """ + + type: Required[Literal["image"]] + """Content type; always image.""" + + image_url: Optional[MediaSourceParam] + """Public HTTP(S) URL or data:image/;base64,. Mutually exclusive with file_id.""" + + file_id: Optional[MediaFileIDParam] + """Active image file ID from the Files API. Mutually exclusive with image_url.""" + + detail: Optional[ImageDetail] + """Analysis detail: low or high. Omitted means high. image_pixel_limit takes precedence when supplied, but does not make an unsupported detail valid.""" + + image_pixel_limit: Optional[ImagePixelLimitParam] + """Optional resolution hints for this image. Model input size, dimensions, aspect ratio and format limits still apply.""" diff --git a/src/arkruntime/types/systemone/image_detail.py b/src/arkruntime/types/systemone/image_detail.py new file mode 100644 index 0000000..1103466 --- /dev/null +++ b/src/arkruntime/types/systemone/image_detail.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from enum import Enum + + +class ImageDetail(str, Enum): + """ + Image analysis detail: low or high. Omitted means high. Higher detail may use more input tokens. An unsupported value returns 400 with param pointing to state[i].detail. + """ + + low = "low" + high = "high" diff --git a/src/arkruntime/types/systemone/image_pixel_limit.py b/src/arkruntime/types/systemone/image_pixel_limit.py new file mode 100644 index 0000000..11bc178 --- /dev/null +++ b/src/arkruntime/types/systemone/image_pixel_limit.py @@ -0,0 +1,28 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Optional + +from arkruntime._models import BaseModel + +from .positive_pixels import PositivePixels + + +class ImagePixelLimit(BaseModel): + """ + Image processing resolution hints. These take precedence over detail but do not override the selected model's image input limits. When both values are supplied, min_pixels must not exceed max_pixels. + """ + + max_pixels: Optional[PositivePixels] = None + """ + Maximum number of pixels to use when processing this image. Omit to use the model's processing policy. + """ + min_pixels: Optional[PositivePixels] = None + """ + Minimum number of pixels to use when processing this image. Omit to use the model's processing policy. + """ diff --git a/src/arkruntime/types/systemone/image_pixel_limit_param.py b/src/arkruntime/types/systemone/image_pixel_limit_param.py new file mode 100644 index 0000000..ea10b58 --- /dev/null +++ b/src/arkruntime/types/systemone/image_pixel_limit_param.py @@ -0,0 +1,25 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Optional + +from typing_extensions import TypedDict + +from .positive_pixels_param import PositivePixelsParam + + +class ImagePixelLimitParam(TypedDict, total=False): + """ + Image processing resolution hints. These take precedence over detail but do not override the selected model's image input limits. When both values are supplied, min_pixels must not exceed max_pixels. + """ + + max_pixels: Optional[PositivePixelsParam] + """Maximum number of pixels to use when processing this image. Omit to use the model's processing policy.""" + + min_pixels: Optional[PositivePixelsParam] + """Minimum number of pixels to use when processing this image. Omit to use the model's processing policy.""" diff --git a/src/arkruntime/types/systemone/instructions.py b/src/arkruntime/types/systemone/instructions.py new file mode 100644 index 0000000..a064ba9 --- /dev/null +++ b/src/arkruntime/types/systemone/instructions.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Union + +from typing_extensions import TypeAliasType + +from .json_object import JSONObject + +Instructions = TypeAliasType("Instructions", Union[str, JSONObject, List[object]]) +""" +One instruction or score-level description: a string, JSON object or array. Nested JSON is retained. Top-level null, numbers and booleans are rejected. +""" diff --git a/src/arkruntime/types/systemone/instructions_param.py b/src/arkruntime/types/systemone/instructions_param.py new file mode 100644 index 0000000..9f6cd22 --- /dev/null +++ b/src/arkruntime/types/systemone/instructions_param.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Union + +from typing_extensions import TypeAlias + +from .json_object_param import JSONObjectParam + +InstructionsParam: TypeAlias = Union[str, JSONObjectParam, List[object]] +""" +One instruction or score-level description: a string, JSON object or array. Nested JSON is retained. Top-level null, numbers and booleans are rejected. +""" diff --git a/src/arkruntime/types/systemone/json_object.py b/src/arkruntime/types/systemone/json_object.py new file mode 100644 index 0000000..1d45b49 --- /dev/null +++ b/src/arkruntime/types/systemone/json_object.py @@ -0,0 +1,16 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict + +from typing_extensions import TypeAliasType + +JSONObject = TypeAliasType("JSONObject", Dict[str, object]) +""" +Arbitrary JSON object. Nested values, including null, are retained as evaluation content. +""" diff --git a/src/arkruntime/types/systemone/json_object_param.py b/src/arkruntime/types/systemone/json_object_param.py new file mode 100644 index 0000000..8815405 --- /dev/null +++ b/src/arkruntime/types/systemone/json_object_param.py @@ -0,0 +1,16 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict + +from typing_extensions import TypeAlias + +JSONObjectParam: TypeAlias = Dict[str, object] +""" +Arbitrary JSON object. Nested values, including null, are retained as evaluation content. +""" diff --git a/src/arkruntime/types/systemone/media_file_id.py b/src/arkruntime/types/systemone/media_file_id.py new file mode 100644 index 0000000..ecd3ed0 --- /dev/null +++ b/src/arkruntime/types/systemone/media_file_id.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +MediaFileID = TypeAliasType("MediaFileID", Annotated[str, Field(pattern="\\S")]) +""" +Public file ID returned by POST /api/v3/files in the selected region. Wait until the file is active and use credentials with access to it. The file must match the content type; unavailable, inactive or mismatched files return a parameter error. Do not use an object-storage key or download URL as a file ID. +""" diff --git a/src/arkruntime/types/systemone/media_file_id_param.py b/src/arkruntime/types/systemone/media_file_id_param.py new file mode 100644 index 0000000..1eb9cc2 --- /dev/null +++ b/src/arkruntime/types/systemone/media_file_id_param.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing_extensions import TypeAlias + + +MediaFileIDParam: TypeAlias = str +""" +Public file ID returned by POST /api/v3/files in the selected region. Wait until the file is active and use credentials with access to it. The file must match the content type; unavailable, inactive or mismatched files return a parameter error. Do not use an object-storage key or download URL as a file ID. +""" diff --git a/src/arkruntime/types/systemone/media_source.py b/src/arkruntime/types/systemone/media_source.py new file mode 100644 index 0000000..82cdddf --- /dev/null +++ b/src/arkruntime/types/systemone/media_source.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +MediaSource = TypeAliasType("MediaSource", Annotated[str, Field(pattern="\\S")]) +""" +A nonempty media source. HTTP(S) URLs must be accessible for the duration of the request; embedded username/password credentials are not accepted. URL download failures are request failures. Base64 sources must use data:;base64,, not bare Base64. The declared media type must match the content. Supported formats and size/duration limits depend on the model and media decoding support. A recognized filename extension alone does not establish support. +""" diff --git a/src/arkruntime/types/systemone/media_source_param.py b/src/arkruntime/types/systemone/media_source_param.py new file mode 100644 index 0000000..f90c407 --- /dev/null +++ b/src/arkruntime/types/systemone/media_source_param.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing_extensions import TypeAlias + + +MediaSourceParam: TypeAlias = str +""" +A nonempty media source. HTTP(S) URLs must be accessible for the duration of the request; embedded username/password credentials are not accepted. URL download failures are request failures. Base64 sources must use data:;base64,, not bare Base64. The declared media type must match the content. Supported formats and size/duration limits depend on the model and media decoding support. A recognized filename extension alone does not establish support. +""" diff --git a/src/arkruntime/types/systemone/model_id.py b/src/arkruntime/types/systemone/model_id.py new file mode 100644 index 0000000..0247605 --- /dev/null +++ b/src/arkruntime/types/systemone/model_id.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +ModelID = TypeAliasType( + "ModelID", + Annotated[str, Field(examples=["doubao-seed-2-1-lite-260915"], pattern="\\S")], +) +""" +Model identifier. A request accepts a model ID or Endpoint ID available to your account in the selected region; a response identifies the evaluated model and version. The string must contain at least one non-whitespace character. +""" diff --git a/src/arkruntime/types/systemone/model_id_param.py b/src/arkruntime/types/systemone/model_id_param.py new file mode 100644 index 0000000..84e6fc8 --- /dev/null +++ b/src/arkruntime/types/systemone/model_id_param.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing_extensions import TypeAlias + + +ModelIDParam: TypeAlias = str +""" +Model identifier. A request accepts a model ID or Endpoint ID available to your account in the selected region; a response identifies the evaluated model and version. The string must contain at least one non-whitespace character. +""" diff --git a/src/arkruntime/types/systemone/noul_answer.py b/src/arkruntime/types/systemone/noul_answer.py new file mode 100644 index 0000000..a6eb0f1 --- /dev/null +++ b/src/arkruntime/types/systemone/noul_answer.py @@ -0,0 +1,28 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal + +from arkruntime._models import BaseModel + +from .probability import Probability + + +class NoulAnswer(BaseModel): + """ + Probability assigned to a yes/no question. + """ + + type: Literal["noul"] + """ + Answer type; matches the question type. + """ + noul: Probability + """ + Probability of yes. Zero is present and valid; noul has no confidence field. + """ diff --git a/src/arkruntime/types/systemone/noul_criteria.py b/src/arkruntime/types/systemone/noul_criteria.py new file mode 100644 index 0000000..c20f2c8 --- /dev/null +++ b/src/arkruntime/types/systemone/noul_criteria.py @@ -0,0 +1,28 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Optional + +from arkruntime._models import BaseModel + +from .nullable_instructions import NullableInstructions + + +class NoulCriteria(BaseModel): + """ + Optional descriptions of the true and false outcomes. Omitted or null descriptions use the model's defaults. An empty object is accepted; other keys are ignored. The criteria object itself cannot be null. + """ + + true: Optional[NullableInstructions] = None + """ + Meaning of the true outcome. Accepts a string, object, array or null; omitted or null uses the model's default description. + """ + false: Optional[NullableInstructions] = None + """ + Meaning of the false outcome. Accepts a string, object, array or null; omitted or null uses the model's default description. + """ diff --git a/src/arkruntime/types/systemone/noul_criteria_param.py b/src/arkruntime/types/systemone/noul_criteria_param.py new file mode 100644 index 0000000..b8d3e8a --- /dev/null +++ b/src/arkruntime/types/systemone/noul_criteria_param.py @@ -0,0 +1,25 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Optional + +from typing_extensions import TypedDict + +from .nullable_instructions_param import NullableInstructionsParam + + +class NoulCriteriaParam(TypedDict, total=False): + """ + Optional descriptions of the true and false outcomes. Omitted or null descriptions use the model's defaults. An empty object is accepted; other keys are ignored. The criteria object itself cannot be null. + """ + + true: Optional[NullableInstructionsParam] + """Meaning of the true outcome. Accepts a string, object, array or null; omitted or null uses the model's default description.""" + + false: Optional[NullableInstructionsParam] + """Meaning of the false outcome. Accepts a string, object, array or null; omitted or null uses the model's default description.""" diff --git a/src/arkruntime/types/systemone/noul_question.py b/src/arkruntime/types/systemone/noul_question.py new file mode 100644 index 0000000..567e734 --- /dev/null +++ b/src/arkruntime/types/systemone/noul_question.py @@ -0,0 +1,33 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + +from .noul_criteria import NoulCriteria +from .nullable_instructions import NullableInstructions + + +class NoulQuestion(BaseModel): + """ + A yes/no question. The answer is the probability of the true outcome. + """ + + type: Literal["noul"] + """ + Question type. Use noul for a yes/no probability. + """ + instructions: Optional[NullableInstructions] = None + """ + Optional evaluation instructions. Omitted or null uses the model's defaults. Empty strings and containers are accepted. + """ + criteria: Optional[NoulCriteria] = None + """ + Optional true/false descriptions. Omit for model defaults. An empty object is valid; null is not. + """ diff --git a/src/arkruntime/types/systemone/noul_question_param.py b/src/arkruntime/types/systemone/noul_question_param.py new file mode 100644 index 0000000..4db5c87 --- /dev/null +++ b/src/arkruntime/types/systemone/noul_question_param.py @@ -0,0 +1,29 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from typing_extensions import Required, TypedDict + +from .noul_criteria_param import NoulCriteriaParam +from .nullable_instructions_param import NullableInstructionsParam + + +class NoulQuestionParam(TypedDict, total=False): + """ + A yes/no question. The answer is the probability of the true outcome. + """ + + type: Required[Literal["noul"]] + """Question type. Use noul for a yes/no probability.""" + + instructions: Optional[NullableInstructionsParam] + """Optional evaluation instructions. Omitted or null uses the model's defaults. Empty strings and containers are accepted.""" + + criteria: Optional[NoulCriteriaParam] + """Optional true/false descriptions. Omit for model defaults. An empty object is valid; null is not.""" diff --git a/src/arkruntime/types/systemone/nullable_instructions.py b/src/arkruntime/types/systemone/nullable_instructions.py new file mode 100644 index 0000000..dd7d2bd --- /dev/null +++ b/src/arkruntime/types/systemone/nullable_instructions.py @@ -0,0 +1,20 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Optional, Union + +from typing_extensions import TypeAliasType + +from .json_object import JSONObject + +NullableInstructions = TypeAliasType( + "NullableInstructions", Optional[Union[str, JSONObject, List[object]]] +) +""" +Evaluation instructions or an outcome description. Accepts a string, JSON object, array or null. Omitted or null values use the model's defaults; nested JSON is retained. +""" diff --git a/src/arkruntime/types/systemone/nullable_instructions_param.py b/src/arkruntime/types/systemone/nullable_instructions_param.py new file mode 100644 index 0000000..1e831e5 --- /dev/null +++ b/src/arkruntime/types/systemone/nullable_instructions_param.py @@ -0,0 +1,20 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Optional, Union + +from typing_extensions import TypeAlias + +from .json_object_param import JSONObjectParam + +NullableInstructionsParam: TypeAlias = Optional[ + Union[str, JSONObjectParam, List[object]] +] +""" +Evaluation instructions or an outcome description. Accepts a string, JSON object, array or null. Omitted or null values use the model's defaults; nested JSON is retained. +""" diff --git a/src/arkruntime/types/systemone/positive_pixels.py b/src/arkruntime/types/systemone/positive_pixels.py new file mode 100644 index 0000000..46f733e --- /dev/null +++ b/src/arkruntime/types/systemone/positive_pixels.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +PositivePixels = TypeAliasType("PositivePixels", Annotated[int, Field(ge=1)]) +""" +Positive image pixel count, expressed as an integer. +""" diff --git a/src/arkruntime/types/systemone/positive_pixels_param.py b/src/arkruntime/types/systemone/positive_pixels_param.py new file mode 100644 index 0000000..c218806 --- /dev/null +++ b/src/arkruntime/types/systemone/positive_pixels_param.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing_extensions import TypeAlias + + +PositivePixelsParam: TypeAlias = int +""" +Positive image pixel count, expressed as an integer. +""" diff --git a/src/arkruntime/types/systemone/probability.py b/src/arkruntime/types/systemone/probability.py new file mode 100644 index 0000000..62d2b34 --- /dev/null +++ b/src/arkruntime/types/systemone/probability.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +Probability = TypeAliasType("Probability", Annotated[float, Field(ge=0.0, le=1.0)]) +""" +Probability or confidence, from 0 to 1 inclusive. Zero is a valid measured value. +""" diff --git a/src/arkruntime/types/systemone/question.py b/src/arkruntime/types/systemone/question.py new file mode 100644 index 0000000..fe7eea5 --- /dev/null +++ b/src/arkruntime/types/systemone/question.py @@ -0,0 +1,26 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +from .choice_question import ChoiceQuestion +from .noul_question import NoulQuestion +from .score_question import ScoreQuestion + +Question = TypeAliasType( + "Question", + Annotated[ + Union[NoulQuestion, ChoiceQuestion, ScoreQuestion], Field(discriminator="type") + ], +) +""" +Each question has exactly one of the three supported types. +""" diff --git a/src/arkruntime/types/systemone/question_param.py b/src/arkruntime/types/systemone/question_param.py new file mode 100644 index 0000000..5e36acb --- /dev/null +++ b/src/arkruntime/types/systemone/question_param.py @@ -0,0 +1,22 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from typing_extensions import TypeAlias + +from .choice_question_param import ChoiceQuestionParam +from .noul_question_param import NoulQuestionParam +from .score_question_param import ScoreQuestionParam + +QuestionParam: TypeAlias = Union[ + NoulQuestionParam, ChoiceQuestionParam, ScoreQuestionParam +] +""" +Each question has exactly one of the three supported types. +""" diff --git a/src/arkruntime/types/systemone/questions.py b/src/arkruntime/types/systemone/questions.py new file mode 100644 index 0000000..38b02fb --- /dev/null +++ b/src/arkruntime/types/systemone/questions.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict + +from typing_extensions import TypeAliasType + +from .question import Question + +Questions = TypeAliasType("Questions", Dict[str, Question]) +""" +Questions keyed by caller-chosen IDs. Empty, whitespace and long IDs are accepted without an identifier-length limit, and are preserved exactly in answers. IDs associate answers with questions and are not evaluated as input text. All questions evaluate the same state independently; they do not form a conversation. Object key order is not an answer-order guarantee: look up answers by ID. At least one question is required. +""" diff --git a/src/arkruntime/types/systemone/questions_param.py b/src/arkruntime/types/systemone/questions_param.py new file mode 100644 index 0000000..cac680a --- /dev/null +++ b/src/arkruntime/types/systemone/questions_param.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict + +from typing_extensions import TypeAlias + +from .question_param import QuestionParam + +QuestionsParam: TypeAlias = Dict[str, QuestionParam] +""" +Questions keyed by caller-chosen IDs. Empty, whitespace and long IDs are accepted without an identifier-length limit, and are preserved exactly in answers. IDs associate answers with questions and are not evaluated as input text. All questions evaluate the same state independently; they do not form a conversation. Object key order is not an answer-order guarantee: look up answers by ID. At least one question is required. +""" diff --git a/src/arkruntime/types/systemone/score_answer.py b/src/arkruntime/types/systemone/score_answer.py new file mode 100644 index 0000000..81b89b2 --- /dev/null +++ b/src/arkruntime/types/systemone/score_answer.py @@ -0,0 +1,42 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict, Literal + +from arkruntime._models import BaseModel + +from .instructions import Instructions +from .probability import Probability +from .score_value import ScoreValue + + +class ScoreAnswer(BaseModel): + """ + Probability-weighted score over the supplied ordered levels. + """ + + type: Literal["score"] + """ + Answer type; matches the question type. + """ + score: ScoreValue + """ + sum(i * p_i), bounded by [0, N-1]; may be fractional and is not normalized. + """ + legend: Dict[str, Instructions] + """ + Keys "0" through "N-1" map to the original level descriptions, retaining string/object/array shapes. + """ + probabilities: Dict[str, Probability] + """ + Keys "0" through "N-1", including zero probabilities; values sum to 1. + """ + confidence: Probability + """ + Confidence in the score, from 0 to 1 inclusive. Its calculation depends on the model. + """ diff --git a/src/arkruntime/types/systemone/score_criteria.py b/src/arkruntime/types/systemone/score_criteria.py new file mode 100644 index 0000000..c35f1b3 --- /dev/null +++ b/src/arkruntime/types/systemone/score_criteria.py @@ -0,0 +1,21 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +from .instructions import Instructions + +ScoreCriteria = TypeAliasType( + "ScoreCriteria", Annotated[List[Instructions], Field(max_length=10, min_length=1)] +) +""" +Ordered descriptions of score levels, numbered 0 through N-1. Each question accepts 1-10 levels, inclusive; a single level is valid and an empty array is invalid. Order is significant. Each description is a non-null string, object or array. +""" diff --git a/src/arkruntime/types/systemone/score_criteria_param.py b/src/arkruntime/types/systemone/score_criteria_param.py new file mode 100644 index 0000000..83652d3 --- /dev/null +++ b/src/arkruntime/types/systemone/score_criteria_param.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List + +from typing_extensions import TypeAlias + +from .instructions_param import InstructionsParam + +ScoreCriteriaParam: TypeAlias = List[InstructionsParam] +""" +Ordered descriptions of score levels, numbered 0 through N-1. Each question accepts 1-10 levels, inclusive; a single level is valid and an empty array is invalid. Order is significant. Each description is a non-null string, object or array. +""" diff --git a/src/arkruntime/types/systemone/score_question.py b/src/arkruntime/types/systemone/score_question.py new file mode 100644 index 0000000..225a4c1 --- /dev/null +++ b/src/arkruntime/types/systemone/score_question.py @@ -0,0 +1,33 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + +from .nullable_instructions import NullableInstructions +from .score_criteria import ScoreCriteria + + +class ScoreQuestion(BaseModel): + """ + A scoring question over an ordered list of levels. + """ + + type: Literal["score"] + """ + Question type. Use score for a probability-weighted level index. + """ + instructions: Optional[NullableInstructions] = None + """ + Optional evaluation instructions. Omitted or null uses the model's defaults. Use instructions to define what increasing levels mean. + """ + criteria: ScoreCriteria + """ + Ordered score levels. Required; 1-10 levels per question, inclusive. The first level has index 0. + """ diff --git a/src/arkruntime/types/systemone/score_question_param.py b/src/arkruntime/types/systemone/score_question_param.py new file mode 100644 index 0000000..0f157c4 --- /dev/null +++ b/src/arkruntime/types/systemone/score_question_param.py @@ -0,0 +1,29 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from typing_extensions import Required, TypedDict + +from .nullable_instructions_param import NullableInstructionsParam +from .score_criteria_param import ScoreCriteriaParam + + +class ScoreQuestionParam(TypedDict, total=False): + """ + A scoring question over an ordered list of levels. + """ + + type: Required[Literal["score"]] + """Question type. Use score for a probability-weighted level index.""" + + instructions: Optional[NullableInstructionsParam] + """Optional evaluation instructions. Omitted or null uses the model's defaults. Use instructions to define what increasing levels mean.""" + + criteria: Required[ScoreCriteriaParam] + """Ordered score levels. Required; 1-10 levels per question, inclusive. The first level has index 0.""" diff --git a/src/arkruntime/types/systemone/score_value.py b/src/arkruntime/types/systemone/score_value.py new file mode 100644 index 0000000..87f0a4e --- /dev/null +++ b/src/arkruntime/types/systemone/score_value.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +ScoreValue = TypeAliasType("ScoreValue", Annotated[float, Field(ge=0.0)]) +""" +Probability-weighted score-level index; the request determines the upper bound. +""" diff --git a/src/arkruntime/types/systemone/state.py b/src/arkruntime/types/systemone/state.py new file mode 100644 index 0000000..5bc29e0 --- /dev/null +++ b/src/arkruntime/types/systemone/state.py @@ -0,0 +1,19 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Union + +from typing_extensions import TypeAliasType + +from .json_object import JSONObject +from .state_objects import StateObjects + +State = TypeAliasType("State", Union[str, JSONObject, List[str], StateObjects]) +""" +Shared evaluation context: string, JSON object, string array, business-object array or multimedia array. Top-level null and arrays containing numbers, booleans, null, nested arrays, or mixed strings/objects are not accepted. An empty array is valid and is treated as empty text. If any object in the top-level array explicitly declares type=text/image/video/audio, every item must be a valid multimedia element; source field names alone do not select multimedia validation. Nested JSON within business objects is preserved; wrap arbitrary business arrays in a top-level object to evaluate them as structured text. +""" diff --git a/src/arkruntime/types/systemone/state_content.py b/src/arkruntime/types/systemone/state_content.py new file mode 100644 index 0000000..a86c32f --- /dev/null +++ b/src/arkruntime/types/systemone/state_content.py @@ -0,0 +1,28 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +from .audio_content import AudioContent +from .image_content import ImageContent +from .text_content import TextContent +from .video_content import VideoContent + +StateContent = TypeAliasType( + "StateContent", + Annotated[ + Union[TextContent, ImageContent, VideoContent, AudioContent], + Field(discriminator="type"), + ], +) +""" +A multimedia element. Each element has a type and only the fields for that type. +""" diff --git a/src/arkruntime/types/systemone/state_content_param.py b/src/arkruntime/types/systemone/state_content_param.py new file mode 100644 index 0000000..6f50cab --- /dev/null +++ b/src/arkruntime/types/systemone/state_content_param.py @@ -0,0 +1,23 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Union + +from typing_extensions import TypeAlias + +from .audio_content_param import AudioContentParam +from .image_content_param import ImageContentParam +from .text_content_param import TextContentParam +from .video_content_param import VideoContentParam + +StateContentParam: TypeAlias = Union[ + TextContentParam, ImageContentParam, VideoContentParam, AudioContentParam +] +""" +A multimedia element. Each element has a type and only the fields for that type. +""" diff --git a/src/arkruntime/types/systemone/state_objects.py b/src/arkruntime/types/systemone/state_objects.py new file mode 100644 index 0000000..a98e32f --- /dev/null +++ b/src/arkruntime/types/systemone/state_objects.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List + +from typing_extensions import TypeAliasType + +from .json_object import JSONObject + +StateObjects = TypeAliasType("StateObjects", List[JSONObject]) +""" +Array of business objects or multimedia elements. If any element explicitly declares type=text/image/video/audio, every element must be a valid multimedia element. Otherwise the array is structured text: image_url/video_url/audio_url/file_id keys alone do not trigger media validation or retrieval, including when type has an unrelated business value. For example, [{"file_id":"INV-1","amount":49}] is a business record. +""" diff --git a/src/arkruntime/types/systemone/state_objects_param.py b/src/arkruntime/types/systemone/state_objects_param.py new file mode 100644 index 0000000..c38511c --- /dev/null +++ b/src/arkruntime/types/systemone/state_objects_param.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List + +from typing_extensions import TypeAlias + +from .json_object_param import JSONObjectParam + +StateObjectsParam: TypeAlias = List[JSONObjectParam] +""" +Array of business objects or multimedia elements. If any element explicitly declares type=text/image/video/audio, every element must be a valid multimedia element. Otherwise the array is structured text: image_url/video_url/audio_url/file_id keys alone do not trigger media validation or retrieval, including when type has an unrelated business value. For example, [{"file_id":"INV-1","amount":49}] is a business record. +""" diff --git a/src/arkruntime/types/systemone/state_param.py b/src/arkruntime/types/systemone/state_param.py new file mode 100644 index 0000000..23b1f94 --- /dev/null +++ b/src/arkruntime/types/systemone/state_param.py @@ -0,0 +1,19 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Union + +from typing_extensions import TypeAlias + +from .json_object_param import JSONObjectParam +from .state_objects_param import StateObjectsParam + +StateParam: TypeAlias = Union[str, JSONObjectParam, List[str], StateObjectsParam] +""" +Shared evaluation context: string, JSON object, string array, business-object array or multimedia array. Top-level null and arrays containing numbers, booleans, null, nested arrays, or mixed strings/objects are not accepted. An empty array is valid and is treated as empty text. If any object in the top-level array explicitly declares type=text/image/video/audio, every item must be a valid multimedia element; source field names alone do not select multimedia validation. Nested JSON within business objects is preserved; wrap arbitrary business arrays in a top-level object to evaluate them as structured text. +""" diff --git a/src/arkruntime/types/systemone/system_one_request.py b/src/arkruntime/types/systemone/system_one_request.py new file mode 100644 index 0000000..578cc6f --- /dev/null +++ b/src/arkruntime/types/systemone/system_one_request.py @@ -0,0 +1,32 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from arkruntime._models import BaseModel + +from .model_id import ModelID +from .questions import Questions +from .state import State + + +class SystemOneRequest(BaseModel): + """ + Evaluate several questions against one shared state. Model-specific text, request-size and context limits apply. When an aggregate text-byte limit applies, it counts decoded UTF-8 strings and compact JSON objects/arrays across state text, all instructions and criteria. Shared state is counted once; media references, Base64, model and question IDs are excluded from that text total. Request-size limits include encoded media in the JSON body and are separate from decoded media limits and model token budgets. Send a UTF-8 encoded JSON object. Invalid JSON syntax returns 400 / InvalidParameter with param="body format". A failed request returns one error instead of partial answers. + """ + + model: ModelID + """ + Model ID or Endpoint ID with System One capability. Use an ID available to your account in the selected region; third-party aliases are not automatically mapped. A model without this capability returns 400 / InvalidParameter with param=model. Missing or inaccessible models can return 404; access denied at the API entry can return 403. Merely supporting Chat or Responses does not imply System One support. + """ + state: State + """ + Shared text, structured data or multimedia to evaluate. Required; an empty string, array or object is accepted, while null is not. Top-level arrays must contain only strings or only objects. In object arrays, an explicit type=text/image/video/audio selects multimedia validation for the whole array. Source keys such as file_id or image_url alone remain business data. + """ + questions: Questions + """ + Named questions to evaluate against state. Required and nonempty. + """ diff --git a/src/arkruntime/types/systemone/system_one_request_param.py b/src/arkruntime/types/systemone/system_one_request_param.py new file mode 100644 index 0000000..c476845 --- /dev/null +++ b/src/arkruntime/types/systemone/system_one_request_param.py @@ -0,0 +1,29 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + + +from .model_id_param import ModelIDParam +from .questions_param import QuestionsParam +from .state_param import StateParam + + +class SystemOneRequestParam(TypedDict, total=False): + """ + Evaluate several questions against one shared state. Model-specific text, request-size and context limits apply. When an aggregate text-byte limit applies, it counts decoded UTF-8 strings and compact JSON objects/arrays across state text, all instructions and criteria. Shared state is counted once; media references, Base64, model and question IDs are excluded from that text total. Request-size limits include encoded media in the JSON body and are separate from decoded media limits and model token budgets. Send a UTF-8 encoded JSON object. Invalid JSON syntax returns 400 / InvalidParameter with param="body format". A failed request returns one error instead of partial answers. + """ + + model: Required[ModelIDParam] + """Model ID or Endpoint ID with System One capability. Use an ID available to your account in the selected region; third-party aliases are not automatically mapped. A model without this capability returns 400 / InvalidParameter with param=model. Missing or inaccessible models can return 404; access denied at the API entry can return 403. Merely supporting Chat or Responses does not imply System One support.""" + + state: Required[StateParam] + """Shared text, structured data or multimedia to evaluate. Required; an empty string, array or object is accepted, while null is not. Top-level arrays must contain only strings or only objects. In object arrays, an explicit type=text/image/video/audio selects multimedia validation for the whole array. Source keys such as file_id or image_url alone remain business data.""" + + questions: Required[QuestionsParam] + """Named questions to evaluate against state. Required and nonempty.""" diff --git a/src/arkruntime/types/systemone/system_one_response.py b/src/arkruntime/types/systemone/system_one_response.py new file mode 100644 index 0000000..29011d3 --- /dev/null +++ b/src/arkruntime/types/systemone/system_one_response.py @@ -0,0 +1,34 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Dict + +from arkruntime._models import BaseModel + +from .answer import Answer +from .model_id import ModelID +from .usage import Usage + + +class SystemOneResponse(BaseModel): + """ + Complete synchronous evaluation result. No partial-success answer envelope is returned. + """ + + model: ModelID + """ + Public identifier of the model that performed the evaluation, including its version. This can differ from the requested model alias or Endpoint ID; it is not an echo of an ep- identifier. + """ + answers: Dict[str, Answer] + """ + Exactly the request question IDs, each with its matching answer type. + """ + usage: Usage + """ + Token usage for this evaluation. + """ diff --git a/src/arkruntime/types/systemone/text_content.py b/src/arkruntime/types/systemone/text_content.py new file mode 100644 index 0000000..f668ecd --- /dev/null +++ b/src/arkruntime/types/systemone/text_content.py @@ -0,0 +1,28 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal + +from arkruntime._models import BaseModel + +from .text_value import TextValue + + +class TextContent(BaseModel): + """ + A text element within a multimedia state array. + """ + + type: Literal["text"] + """ + Content type; always text. + """ + text: TextValue + """ + Text or structured content. Required and non-null; arrays contain only strings. + """ diff --git a/src/arkruntime/types/systemone/text_content_param.py b/src/arkruntime/types/systemone/text_content_param.py new file mode 100644 index 0000000..8ac37e6 --- /dev/null +++ b/src/arkruntime/types/systemone/text_content_param.py @@ -0,0 +1,25 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import Required, TypedDict + +from .text_value_param import TextValueParam + + +class TextContentParam(TypedDict, total=False): + """ + A text element within a multimedia state array. + """ + + type: Required[Literal["text"]] + """Content type; always text.""" + + text: Required[TextValueParam] + """Text or structured content. Required and non-null; arrays contain only strings.""" diff --git a/src/arkruntime/types/systemone/text_value.py b/src/arkruntime/types/systemone/text_value.py new file mode 100644 index 0000000..fc33d60 --- /dev/null +++ b/src/arkruntime/types/systemone/text_value.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Union + +from typing_extensions import TypeAliasType + +from .json_object import JSONObject + +TextValue = TypeAliasType("TextValue", Union[str, List[str], JSONObject]) +""" +Text content: a string, an array containing only strings, or a JSON object. Empty values are accepted. +""" diff --git a/src/arkruntime/types/systemone/text_value_param.py b/src/arkruntime/types/systemone/text_value_param.py new file mode 100644 index 0000000..81852a5 --- /dev/null +++ b/src/arkruntime/types/systemone/text_value_param.py @@ -0,0 +1,18 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import List, Union + +from typing_extensions import TypeAlias + +from .json_object_param import JSONObjectParam + +TextValueParam: TypeAlias = Union[str, List[str], JSONObjectParam] +""" +Text content: a string, an array containing only strings, or a JSON object. Empty values are accepted. +""" diff --git a/src/arkruntime/types/systemone/token_count.py b/src/arkruntime/types/systemone/token_count.py new file mode 100644 index 0000000..095fc57 --- /dev/null +++ b/src/arkruntime/types/systemone/token_count.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +TokenCount = TypeAliasType("TokenCount", Annotated[int, Field(ge=0)]) +""" +Nonnegative token count. Zero is retained in the response. +""" diff --git a/src/arkruntime/types/systemone/usage.py b/src/arkruntime/types/systemone/usage.py new file mode 100644 index 0000000..95e3c4d --- /dev/null +++ b/src/arkruntime/types/systemone/usage.py @@ -0,0 +1,26 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from arkruntime._models import BaseModel + +from .token_count import TokenCount + + +class Usage(BaseModel): + """ + Token usage for the complete evaluation. Clients must tolerate additional usage fields added in future versions. Zero can also mean the model did not supply a count for that field; it does not establish that the evaluation is free. These counts alone do not specify prices or discounts; consult the selected model pricing. + """ + + input_tokens: TokenCount + """ + Total input tokens reported for this evaluation, including cached input tokens when measured. This is not a character count; shared context may contribute to multiple question evaluations. + """ + output_tokens: TokenCount + """ + Output tokens reported for the complete evaluation. Not the number of bytes in the JSON response. + """ diff --git a/src/arkruntime/types/systemone/video_content.py b/src/arkruntime/types/systemone/video_content.py new file mode 100644 index 0000000..5bcec3e --- /dev/null +++ b/src/arkruntime/types/systemone/video_content.py @@ -0,0 +1,38 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from arkruntime._models import BaseModel + +from .media_file_id import MediaFileID +from .media_source import MediaSource +from .video_fps import VideoFPS + + +class VideoContent(BaseModel): + """ + A video, supplied by exactly one of video_url or file_id. The video is sampled into images for evaluation; audio is also processed when present and supported. + """ + + type: Literal["video"] + """ + Content type; always video. + """ + video_url: Optional[MediaSource] = None + """ + Public HTTP(S) URL or data:video/;base64,. Mutually exclusive with file_id. + """ + file_id: Optional[MediaFileID] = None + """ + Active video file ID from the Files API. Mutually exclusive with video_url. + """ + fps: Optional[VideoFPS] = None + """ + Sampling rate in frames per second. Omitted means 1.0. A lower value can reduce sampled frames, but a model's minimum frame count can make token usage unchanged. + """ diff --git a/src/arkruntime/types/systemone/video_content_param.py b/src/arkruntime/types/systemone/video_content_param.py new file mode 100644 index 0000000..2811bb6 --- /dev/null +++ b/src/arkruntime/types/systemone/video_content_param.py @@ -0,0 +1,33 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal, Optional + +from typing_extensions import Required, TypedDict + +from .media_file_id_param import MediaFileIDParam +from .media_source_param import MediaSourceParam +from .video_fps_param import VideoFPSParam + + +class VideoContentParam(TypedDict, total=False): + """ + A video, supplied by exactly one of video_url or file_id. The video is sampled into images for evaluation; audio is also processed when present and supported. + """ + + type: Required[Literal["video"]] + """Content type; always video.""" + + video_url: Optional[MediaSourceParam] + """Public HTTP(S) URL or data:video/;base64,. Mutually exclusive with file_id.""" + + file_id: Optional[MediaFileIDParam] + """Active video file ID from the Files API. Mutually exclusive with video_url.""" + + fps: Optional[VideoFPSParam] + """Sampling rate in frames per second. Omitted means 1.0. A lower value can reduce sampled frames, but a model's minimum frame count can make token usage unchanged.""" diff --git a/src/arkruntime/types/systemone/video_fps.py b/src/arkruntime/types/systemone/video_fps.py new file mode 100644 index 0000000..f2059a5 --- /dev/null +++ b/src/arkruntime/types/systemone/video_fps.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import Field +from typing_extensions import Annotated, TypeAliasType + +VideoFPS = TypeAliasType("VideoFPS", Annotated[float, Field(ge=0.2, le=5.0)]) +""" +Requested video frame sampling rate, in frames per second. Inclusive range: 0.2–5. Values outside this range are rejected. +""" diff --git a/src/arkruntime/types/systemone/video_fps_param.py b/src/arkruntime/types/systemone/video_fps_param.py new file mode 100644 index 0000000..4dd0251 --- /dev/null +++ b/src/arkruntime/types/systemone/video_fps_param.py @@ -0,0 +1,15 @@ +# Generated by datamodel-code-generator from ark-apis typespec/openapi. +# DO NOT EDIT — regenerate with `make gen-py-` in ark-apis. +# +# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing_extensions import TypeAlias + + +VideoFPSParam: TypeAlias = float +""" +Requested video frame sampling rate, in frames per second. Inclusive range: 0.2–5. Values outside this range are rejected. +""" diff --git a/uv.lock b/uv.lock index cbeaefa..a6ae632 100644 --- a/uv.lock +++ b/uv.lock @@ -79,7 +79,7 @@ wheels = [ [[package]] name = "arkruntime" -version = "0.15.0" +version = "0.16.0" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9'" },