Class DecideProductGroupsTool
java.lang.Object
ai.redouble.nucleo.harness.AbstractJob<ProductGroups>
ai.redouble.nucleo.tools.AbstractTool<ProductNames, ProductGroups>
ai.redouble.demo.pricing.DecideProductGroupsTool
- All Implemented Interfaces:
GuardedExecution, Identifiable, Job<ProductGroups>, Tool<ProductNames, ProductGroups>
The grouping tier of the pricing demo on a decision model: the same names in, the same
groups out as
CanonicalizeProductsTool. Two decisions. The first is one verdict per
pair of names, "do these two mean the same product", the shape a decision model is best
at; every pair the model says yes to joins their groups. The second, for each group of
more than one name, is a choice of the name that is the product's proper name, without a
brand in front, a descriptor behind or a size. The model writes no name: every group is
made of the names the documents used.- Since:
- 0.1 (2026-09-25)
- Author:
- Andrey Santrosyan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe probability a verdict must reach to join two names.Fields inherited from class AbstractTool
inputFields inherited from class AbstractJob
timeout, upstreamRetriesFields inherited from interface Job
DEFAULT_UPSTREAM_RETRIESFields inherited from interface Tool
OBS_INPUT, OBS_OUTPUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(JobResources resources, JobContext<ProductGroups> context) Executes the job with the provided resources and context.Default requirements for tools.Methods inherited from class AbstractTool
getInput, getJobType, postExecute, preExecute, setInputMethods inherited from class AbstractJob
getId, getName, getParentJobId, getPriority, getTimeout, getUpstreamRetries, getUserId, getWorkflowId, randomIdSuffix, setTimeout, setUpstreamRetries, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface GuardedExecution
declareAdmissionGuardrails, declareAuthGuardrails, declareContentGuardrailsMethods inherited from interface Identifiable
getParentJobId, getUserId, getWorkflowIdMethods inherited from interface Job
getDisplayName, getId, getJobId, getName, getPriority, getTimeout, getUpstreamRetriesMethods inherited from interface Tool
guardedInputTarget
-
Field Details
-
THRESHOLD
public static final double THRESHOLDThe probability a verdict must reach to join two names.- See Also:
-
-
Constructor Details
-
DecideProductGroupsTool
-
-
Method Details
-
getRequirements
Description copied from class:AbstractToolDefault requirements for tools. Subclasses should override to add database, LLM, or other requirements. JobType is handled byAbstractTool.getJobType(), not here.- Specified by:
getRequirementsin interfaceJob<ProductGroups>- Overrides:
getRequirementsin classAbstractTool<ProductNames, ProductGroups>- Returns:
- resource requirements, or null if the job needs no resources
-
execute
public ProductGroups execute(JobResources resources, JobContext<ProductGroups> context) throws LLMReadableCheckedException Description copied from interface:JobExecutes the job with the provided resources and context. A job reports progress and checks for cancellation through the context, and completes all its work before returning. A tool narrows this contract to the LLM-readable exceptions ofTool.execute(JobResources, JobContext).- Parameters:
resources- the allocated resourcescontext- the job execution context for monitoring- Returns:
- the job result, which may be null
- Throws:
LLMReadableCheckedException- if execution fails
-