Package com.tnsai.thread
Class ThreadSpec
java.lang.Object
com.tnsai.thread.ThreadSpec
Configuration for an
AgentThread.
Includes:
- Resource quotas (tokens, tool calls, duration)
- Recovery settings (auto-resume, max retries)
- Spec (tags, labels)
- Checkpoint frequency
Example:
ThreadSpec config = ThreadSpec.builder()
.name("search-thread")
.quota(ResourceQuota.builder()
.maxTokens(50000)
.maxToolCalls(20)
.build())
.autoCheckpoint(true)
.checkpointInterval(Duration.ofMinutes(5))
.metadata("task", "web-search")
.build();
- Since:
- 0.0.2
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadSpec.Builderbuilder()static ThreadSpecdefaults()Create a default configuration.intgetName()getQuota()getSpec()<T> TGet a metadata value.<T> TGet a metadata value with default.booleanbooleanbooleanbooleanstatic ThreadSpecCreate a configuration for long-running tasks.static ThreadSpecCreate a configuration for short-lived tasks.toString()
-
Method Details
-
defaults
Create a default configuration. -
shortLived
Create a configuration for short-lived tasks. -
longRunning
Create a configuration for long-running tasks. -
builder
-
getName
-
getQuota
-
isAutoCheckpoint
public boolean isAutoCheckpoint() -
getCheckpointInterval
-
isAutoResume
public boolean isAutoResume() -
getMaxRetries
public int getMaxRetries() -
getRetryDelay
-
getSpec
-
isInheritParentState
public boolean isInheritParentState() -
isPropagateExceptions
public boolean isPropagateExceptions() -
getSpec
Get a metadata value. -
getSpec
Get a metadata value with default. -
toString
-