类 SubTask
java.lang.Object
io.agentscope.core.plan.model.SubTask
Represents a subtask within a plan.
A subtask is a unit of work with a specific goal and expected outcome. It has a state that tracks its progress through the execution lifecycle.
Usage Example:
SubTask task = new SubTask(
"Setup project",
"Initialize project structure with proper directory layout",
"Project scaffolding completed");
task.setState(SubTaskState.IN_PROGRESS);
// ... execute task
task.finish("Project initialized with src/, test/, and docs/ directories");
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidfinish(SubTaskState state, String outcome) Mark the subtask as finished with a specific state and outcome.voidMark the subtask as finished with the actual outcome.Gets the creation timestamp of this subtask.Gets the description of this subtask.Gets the expected outcome for this subtask.Gets the timestamp when this subtask was finished.getName()Gets the name of this subtask.Gets the actual outcome achieved by this subtask.getState()Gets the current state of this subtask.voidsetCreatedAt(String createdAt) Sets the creation timestamp of this subtask.voidsetDescription(String description) Sets the description of this subtask.voidsetExpectedOutcome(String expectedOutcome) Sets the expected outcome for this subtask.voidsetFinishedAt(String finishedAt) Sets the timestamp when this subtask was finished.voidSets the name of this subtask.voidsetOutcome(String outcome) Sets the actual outcome of this subtask.voidsetState(SubTaskState state) Sets the state of this subtask.toMarkdown(boolean detailed) Convert to markdown representation.Convert to one-line markdown representation.
-
构造器详细资料
-
SubTask
public SubTask()Default constructor for deserialization. -
SubTask
Create a new subtask.- 参数:
name- The subtask name (should be concise, not exceed 10 words)description- The detailed description including constraints and targetsexpectedOutcome- The expected outcome, specific and measurable
-
-
方法详细资料
-
finish
Mark the subtask as finished with the actual outcome.- 参数:
outcome- The actual outcome achieved
-
finish
Mark the subtask as finished with a specific state and outcome.- 参数:
state- The final state (e.g., DONE or ABANDONED)outcome- The actual outcome or reason for abandoning- 抛出:
IllegalArgumentException- if the state is not a terminal state (DONE or ABANDONED)
-
toOneLineMarkdown
Convert to one-line markdown representation.- 返回:
- One-line markdown string
-
toMarkdown
Convert to markdown representation.- 参数:
detailed- Whether to include detailed information- 返回:
- Markdown string representation
-
getName
Gets the name of this subtask.- 返回:
- The subtask name
-
setName
Sets the name of this subtask.- 参数:
name- The subtask name
-
getDescription
Gets the description of this subtask.- 返回:
- The detailed description
-
setDescription
Sets the description of this subtask.- 参数:
description- The detailed description
-
getExpectedOutcome
Gets the expected outcome for this subtask.- 返回:
- The expected outcome
-
setExpectedOutcome
Sets the expected outcome for this subtask.- 参数:
expectedOutcome- The expected outcome
-
getOutcome
Gets the actual outcome achieved by this subtask.- 返回:
- The actual outcome, or null if not finished
-
setOutcome
Sets the actual outcome of this subtask.- 参数:
outcome- The actual outcome
-
getState
Gets the current state of this subtask.- 返回:
- The subtask state (TODO, IN_PROGRESS, DONE, or ABANDONED)
-
setState
Sets the state of this subtask.- 参数:
state- The subtask state
-
getCreatedAt
Gets the creation timestamp of this subtask.- 返回:
- The creation time (formatted as "yyyy-MM-dd HH:mm:ss")
-
setCreatedAt
Sets the creation timestamp of this subtask.- 参数:
createdAt- The creation time
-
getFinishedAt
Gets the timestamp when this subtask was finished.- 返回:
- The finish time, or null if not finished yet
-
setFinishedAt
Sets the timestamp when this subtask was finished.- 参数:
finishedAt- The finish time
-