Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.15.0
0.16.0
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/arkruntime/types/audio_generation/audio_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
class AudioURL(BaseModel):
url: NonEmptyString
"""
Public HTTP(S) URL, speaker://<id>, file://<file_id> for registered reference audio, or data:audio/{wav,mp3};base64,<payload>. 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://<id> for a preset speaker, file://<file_id> for a custom voice registered through the Files API, or data:audio/{wav,mp3};base64,<payload>. 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.
"""
2 changes: 1 addition & 1 deletion src/arkruntime/types/audio_generation/audio_url_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

class AudioURLParam(TypedDict, total=False):
url: Required[NonEmptyStringParam]
"""Public HTTP(S) URL, speaker://<id>, file://<file_id> for registered reference audio, or data:audio/{wav,mp3};base64,<payload>. 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://<id> for a preset speaker, file://<file_id> for a custom voice registered through the Files API, or data:audio/{wav,mp3};base64,<payload>. 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."""
2 changes: 1 addition & 1 deletion src/arkruntime/types/audio_generation/video_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
class VideoURL(BaseModel):
url: NonEmptyString
"""
Public HTTP(S) URL or tos://<bucket>/<key>. Base64 and speaker references are not supported. Media properties and size are validated by the server.
Public HTTP(S) URL or tos://<bucket>/<key>. 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.
"""
2 changes: 1 addition & 1 deletion src/arkruntime/types/audio_generation/video_url_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

class VideoURLParam(TypedDict, total=False):
url: Required[NonEmptyStringParam]
"""Public HTTP(S) URL or tos://<bucket>/<key>. Base64 and speaker references are not supported. Media properties and size are validated by the server."""
"""Public HTTP(S) URL or tos://<bucket>/<key>. 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."""
17 changes: 17 additions & 0 deletions src/arkruntime/types/responses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -322,6 +328,8 @@
"ItemReasoning",
"ItemReference",
"ItemStatus",
"ItemToolSearchCall",
"ItemToolSearchOutput",
"ItemTranscription",
"KnowledgeSearchTool",
"ListInputItemsResponse",
Expand All @@ -336,6 +344,7 @@
"McpToolApprovalFilterNever",
"MessageContent",
"MessageRole",
"NamespaceTool",
"Order",
"OutputContentItem",
"OutputContentItemReasoningText",
Expand Down Expand Up @@ -436,6 +445,9 @@
"ToolChoiceOptions",
"ToolChoiceWebSearch",
"ToolNameList",
"ToolSearchExecution",
"ToolSearchResultTool",
"ToolSearchTool",
"ToolUsage",
"ToolUsageDetails",
"ToolUsesKeep",
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/arkruntime/types/responses/function_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
3 changes: 3 additions & 0 deletions src/arkruntime/types/responses/function_tool_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
4 changes: 4 additions & 0 deletions src/arkruntime/types/responses/input_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@
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",
Annotated[
Union[
ItemEasyMessage,
ItemFunctionToolCall,
ItemToolSearchCall,
ItemToolSearchOutput,
ItemFunctionToolCallOutput,
ItemReasoning,
ItemFunctionMcpApprovalRequest,
Expand Down
4 changes: 4 additions & 0 deletions src/arkruntime/types/responses/input_item_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/arkruntime/types/responses/item_function_tool_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
32 changes: 32 additions & 0 deletions src/arkruntime/types/responses/item_tool_search_call.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` 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.
"""
31 changes: 31 additions & 0 deletions src/arkruntime/types/responses/item_tool_search_call_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` 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."""
33 changes: 33 additions & 0 deletions src/arkruntime/types/responses/item_tool_search_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` 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.
"""
32 changes: 32 additions & 0 deletions src/arkruntime/types/responses/item_tool_search_output_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` 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."""
26 changes: 26 additions & 0 deletions src/arkruntime/types/responses/namespace_tool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` 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.
"""
25 changes: 25 additions & 0 deletions src/arkruntime/types/responses/namespace_tool_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by datamodel-code-generator from ark-apis typespec/openapi.
# DO NOT EDIT — regenerate with `make gen-py-<api>` 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."""
Loading
Loading