Annotation Interface ActivationCondition


@Retention(RUNTIME) @Target(METHOD) public @interface ActivationCondition
Marks a method as an activation condition for one or more sub-agents of a conditional agent. The method must be static and return a boolean indicating whether the sub-agent(s) should be activated.

Example:


    public interface ExpertsAgent {

        @ConditionalAgent(outputName = "response", subAgents = {
                @SubAgent(type = MedicalExpert.class, outputName = "response"),
                @SubAgent(type = TechnicalExpert.class, outputName = "response"),
                @SubAgent(type = LegalExpert.class, outputName = "response")
        })
        String askExpert(@V("request") String request);

        @ActivationCondition(MedicalExpert.class)
        static boolean activateMedical(@V("category") RequestCategory category) {
            return category == RequestCategory.MEDICAL;
        }

        @ActivationCondition(TechnicalExpert.class)
        static boolean activateTechnical(@V("category") RequestCategory category) {
            return category == RequestCategory.TECHNICAL;
        }

        @ActivationCondition(LegalExpert.class)
        static boolean activateLegal(AgenticScope agenticScope) {
            return agenticScope.readState("category", RequestCategory.UNKNOWN) == RequestCategory.LEGAL;
        }
    }

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<?>[]
     
  • Element Details

    • value

      Class<?>[] value