Class ToolRegistration
-
- All Implemented Interfaces:
public final class ToolRegistrationIntermediate registration object returned by PlaybookTool.withTool.
Supports both Kotlin curried syntax and Java fluent API:
// Kotlin curried syntax .withTool(analyzeTool)(searchTool) // Kotlin/Java fluent syntax .withTool(analyzeTool).unlockedBy(searchTool)
-
-
Method Summary
Modifier and Type Method Description final PlaybookToolinvoke(Tool prerequisites)Kotlin currying operator - unlock after specified prerequisite tool(s). final PlaybookToolinvoke(KClass<?> artifactType)Kotlin currying operator - unlock when artifact type is produced. final PlaybookToolunlockedBy(Tool prerequisite)Unlock after a single prerequisite tool has been called. final PlaybookToolunlockedByAll(Tool prerequisites)Unlock after ALL specified prerequisite tools have been called (AND logic). final PlaybookToolunlockedByAny(Tool prerequisites)Unlock after ANY of the specified prerequisite tools has been called (OR logic). final PlaybookToolunlockedByArtifact(Class<?> artifactType)Unlock when an artifact of the specified type is produced. final PlaybookToolunlockedByArtifactMatching(Predicate<Object> predicate)Unlock when any artifact matches the given predicate. final PlaybookToolunlockedWhen(UnlockCondition condition)Unlock when a custom condition is met. final PlaybookToolunlockedWhen(Function1<PlaybookContext, Boolean> predicate)Unlock when a predicate returns true. final PlaybookToolunlockedByBlackboard(Class<?> type)Unlock when an object of the specified type exists on the blackboard. final PlaybookToolunlockedByBlackboardMatching(Predicate<Blackboard> predicate)Unlock when the blackboard matches a predicate. -
-
Method Detail
-
invoke
final PlaybookTool invoke(Tool prerequisites)
Kotlin currying operator - unlock after specified prerequisite tool(s). When multiple tools are specified, ALL must be called (AND logic).
Example:
.withTool(analyzeTool)(searchTool) // single prerequisite .withTool(reportTool)(searchTool, analyzeTool) // ALL must be called
-
invoke
final PlaybookTool invoke(KClass<?> artifactType)
Kotlin currying operator - unlock when artifact type is produced.
Example:
.withTool(summarizeTool)(Document::class)
-
unlockedBy
final PlaybookTool unlockedBy(Tool prerequisite)
Unlock after a single prerequisite tool has been called.
Example:
.withTool(analyzeTool).unlockedBy(searchTool)
-
unlockedByAll
final PlaybookTool unlockedByAll(Tool prerequisites)
Unlock after ALL specified prerequisite tools have been called (AND logic).
Example:
.withTool(reportTool).unlockedByAll(searchTool, analyzeTool)
-
unlockedByAny
final PlaybookTool unlockedByAny(Tool prerequisites)
Unlock after ANY of the specified prerequisite tools has been called (OR logic).
Example:
.withTool(processTool).unlockedByAny(searchTool, fetchTool)
-
unlockedByArtifact
final PlaybookTool unlockedByArtifact(Class<?> artifactType)
Unlock when an artifact of the specified type is produced.
Example:
.withTool(summarizeTool).unlockedByArtifact(Document.class)
-
unlockedByArtifactMatching
final PlaybookTool unlockedByArtifactMatching(Predicate<Object> predicate)
Unlock when any artifact matches the given predicate.
Example:
.withTool(processTool).unlockedByArtifactMatching(a -> a instanceof Document && ((Document) a).isValid())
-
unlockedWhen
final PlaybookTool unlockedWhen(UnlockCondition condition)
Unlock when a custom condition is met.
Example:
.withTool(actionTool).unlockedWhen(ctx -> ctx.getIterationCount() 2)
-
unlockedWhen
final PlaybookTool unlockedWhen(Function1<PlaybookContext, Boolean> predicate)
Unlock when a predicate returns true.
Example:
.withTool(actionTool).unlockedWhen { it.calledToolNames.size >= 2 }
-
unlockedByBlackboard
final PlaybookTool unlockedByBlackboard(Class<?> type)
Unlock when an object of the specified type exists on the blackboard.
Example:
.withTool(processTool).unlockedByBlackboard(Document.class)
-
unlockedByBlackboardMatching
final PlaybookTool unlockedByBlackboardMatching(Predicate<Blackboard> predicate)
Unlock when the blackboard matches a predicate.
Example:
.withTool(actionTool).unlockedByBlackboardMatching(bb -> bb.get("ready") != null)
-
-
-
-