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
29 changes: 29 additions & 0 deletions agentrun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@
SandboxClient,
Template,
)
# Super Agent
from agentrun.super_agent import (
ConversationInfo,
InvokeResponseData,
InvokeStream,
)
from agentrun.super_agent import Message as SuperAgentMessage
from agentrun.super_agent import (
SSEEvent,
SuperAgent,
SuperAgentClient,
SuperAgentCreateInput,
SuperAgentListInput,
SuperAgentUpdateInput,
)
# Tool
from agentrun.tool import Tool as ToolResource
from agentrun.tool import ToolClient as ToolResourceClient
Expand Down Expand Up @@ -248,6 +263,20 @@
"ModelProxyCreateInput",
"ModelProxyUpdateInput",
"ModelProxyListInput",
######## Super Agent ########
# base
"SuperAgent",
"SuperAgentClient",
# inner model
"InvokeStream",
"SSEEvent",
"ConversationInfo",
"SuperAgentMessage",
# api model
"SuperAgentCreateInput",
"SuperAgentUpdateInput",
"SuperAgentListInput",
"InvokeResponseData",
######## Sandbox ########
"SandboxClient",
"BrowserSandbox",
Expand Down
7 changes: 6 additions & 1 deletion agentrun/agent_runtime/__client_async_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ async def delete_async(
result = await self.__control_api.delete_agent_runtime_async(
id, config=config
)
return AgentRuntime.from_inner_object(result)
# Delete 响应只有 agentRuntimeId 有效,其他字段为空字符串/零值,
# 走 from_inner_object 会在 status/artifactType 等 Enum 字段上触发
# 伪校验错误。这里直接构造一个只带 id 的极简对象。
return AgentRuntime.model_construct(
agent_runtime_id=result.agent_runtime_id
)
except HTTPError as e:
raise e.to_resource_error("AgentRuntime", id) from e

Expand Down
9 changes: 9 additions & 0 deletions agentrun/agent_runtime/api/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
CreateAgentRuntimeEndpointRequest,
CreateAgentRuntimeInput,
CreateAgentRuntimeRequest,
DeleteAgentRuntimeEndpointRequest,
DeleteAgentRuntimeRequest,
GetAgentRuntimeEndpointRequest,
GetAgentRuntimeRequest,
ListAgentRuntimeEndpointsOutput,
ListAgentRuntimeEndpointsRequest,
Expand Down Expand Up @@ -193,6 +196,7 @@ def delete_agent_runtime(
client = self._get_client(config)
response = client.delete_agent_runtime_with_options(
agent_id,
DeleteAgentRuntimeRequest(),
headers=headers or {},
runtime=RuntimeOptions(),
)
Expand Down Expand Up @@ -248,6 +252,7 @@ async def delete_agent_runtime_async(
client = self._get_client(config)
response = await client.delete_agent_runtime_with_options_async(
agent_id,
DeleteAgentRuntimeRequest(),
headers=headers or {},
runtime=RuntimeOptions(),
)
Expand Down Expand Up @@ -778,6 +783,7 @@ def delete_agent_runtime_endpoint(
response = client.delete_agent_runtime_endpoint_with_options(
agent_id,
endpoint_id,
DeleteAgentRuntimeEndpointRequest(),
headers=headers or {},
runtime=RuntimeOptions(),
)
Expand Down Expand Up @@ -838,6 +844,7 @@ async def delete_agent_runtime_endpoint_async(
await client.delete_agent_runtime_endpoint_with_options_async(
agent_id,
endpoint_id,
DeleteAgentRuntimeEndpointRequest(),
headers=headers or {},
runtime=RuntimeOptions(),
)
Expand Down Expand Up @@ -1028,6 +1035,7 @@ def get_agent_runtime_endpoint(
response = client.get_agent_runtime_endpoint_with_options(
agent_id,
endpoint_id,
GetAgentRuntimeEndpointRequest(),
headers=headers or {},
runtime=RuntimeOptions(),
)
Expand Down Expand Up @@ -1088,6 +1096,7 @@ async def get_agent_runtime_endpoint_async(
await client.get_agent_runtime_endpoint_with_options_async(
agent_id,
endpoint_id,
GetAgentRuntimeEndpointRequest(),
headers=headers or {},
runtime=RuntimeOptions(),
)
Expand Down
14 changes: 12 additions & 2 deletions agentrun/agent_runtime/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ async def delete_async(
result = await self.__control_api.delete_agent_runtime_async(
id, config=config
)
return AgentRuntime.from_inner_object(result)
# Delete 响应只有 agentRuntimeId 有效,其他字段为空字符串/零值,
# 走 from_inner_object 会在 status/artifactType 等 Enum 字段上触发
# 伪校验错误。这里直接构造一个只带 id 的极简对象。
return AgentRuntime.model_construct(
agent_runtime_id=result.agent_runtime_id
)
except HTTPError as e:
raise e.to_resource_error("AgentRuntime", id) from e

Expand All @@ -191,7 +196,12 @@ def delete(self, id: str, config: Optional[Config] = None) -> AgentRuntime:
"""
try:
result = self.__control_api.delete_agent_runtime(id, config=config)
return AgentRuntime.from_inner_object(result)
# Delete 响应只有 agentRuntimeId 有效,其他字段为空字符串/零值,
# 走 from_inner_object 会在 status/artifactType 等 Enum 字段上触发
# 伪校验错误。这里直接构造一个只带 id 的极简对象。
return AgentRuntime.model_construct(
agent_runtime_id=result.agent_runtime_id
)
except HTTPError as e:
raise e.to_resource_error("AgentRuntime", id) from e

Expand Down
5 changes: 5 additions & 0 deletions agentrun/agent_runtime/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class AgentRuntimeProtocolType(str, Enum):

HTTP = "HTTP"
MCP = "MCP"
SUPER_AGENT = "SUPER_AGENT"


class AgentRuntimeProtocolConfig(BaseModel):
Expand Down Expand Up @@ -251,6 +252,8 @@ class AgentRuntimeMutableProps(BaseModel):
"""会话空闲超时时间,单位:秒"""
tags: Optional[List[str]] = None
"""标签列表"""
system_tags: Optional[List[str]] = None
"""系统标签列表 (由平台内部使用, 例如 SuperAgent 用来标识下游 AgentRuntime)"""


class AgentRuntimeImmutableProps(BaseModel):
Expand Down Expand Up @@ -322,6 +325,8 @@ class AgentRuntimeListInput(PageableInput):
"""Agent Runtime 名称"""
tags: Optional[str] = None
"""标签过滤,多个标签用逗号分隔"""
system_tags: Optional[str] = None
"""系统标签过滤, 多个标签用逗号分隔"""
search_mode: Optional[str] = None
"""搜索模式"""

Expand Down
4 changes: 2 additions & 2 deletions agentrun/integration/utils/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1614,8 +1614,8 @@ def _build_openapi_schema(
if isinstance(schema, dict):
properties[name] = {
**schema,
"description": (
param.get("description") or schema.get("description", "")
"description": param.get("description") or schema.get(
"description", ""
),
}
if param.get("required"):
Expand Down
Loading
Loading