AS AgentScopeAPI 手册 / API Reference

TaskRunSpec

public sealed interface TaskRunSpec
源码Source io/agentscope/harness/agent/subagent/task/TaskRunSpec.java:30–61

定义任务运行规格契约的接口。位于 io.agentscope.harness.agent.subagent.task 包。

Discriminated union describing how a background subagent task should execute.

LocalTaskRunSpec runs the supplier on a local executor. RemoteTaskRunSpec delegates to an AgentScope task HTTP API (see agentscope-extensions-agent-protocol). AdoptedTaskRunSpec wraps an already-running CompletableFuture (used when a sync execution is promoted to async on timeout).

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
LocalTaskRunSpec记录record
承载本地任务运行规格数据的记录类型。
In-process execution via `Supplier`.
RemoteTaskRunSpec记录record
承载远程任务运行规格数据的记录类型。
Remote HTTP task execution.
AdoptedTaskRunSpec记录record
承载 Adopted 任务运行规格数据的记录类型。
Adopts an already-running `CompletableFuture` as a tracked background task.

嵌套类详情Nested Class Detail

LocalTaskRunSpec

record LocalTaskRunSpec(Supplier<String> execution) implements TaskRunSpec

承载本地任务运行规格数据的记录类型。位于 io.agentscope.harness.agent.subagent.task 包,实现 TaskRunSpec。核心成员包括 execution。

In-process execution via Supplier.

RemoteTaskRunSpec

record RemoteTaskRunSpec( String baseUrl, Map<String, String> headers, String agentId, String input, RemoteSubmitContext context) implements TaskRunSpec

承载远程任务运行规格数据的记录类型。位于 io.agentscope.harness.agent.subagent.task 包,实现 TaskRunSpec。核心成员包括 baseUrl、headers、agentId、input、context、RemoteTaskRunSpec。

Remote HTTP task execution. The taskId is chosen by the client and used as the remote task key end-to-end. context carries submission-time metadata (streaming preference, propagated deny rules, parent identity); defaults to RemoteSubmitContext#empty() for callers that predate this field.

AdoptedTaskRunSpec

record AdoptedTaskRunSpec(CompletableFuture<String> future) implements TaskRunSpec

承载 Adopted 任务运行规格数据的记录类型。位于 io.agentscope.harness.agent.subagent.task 包,实现 TaskRunSpec。核心成员包括 future。

Adopts an already-running CompletableFuture as a tracked background task. Used when a sync execution exceeds its timeout and is promoted to async: the future is still in progress and only needs status-tracking callbacks, not a new executor submission.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.