Annotation Type SKSample


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface SKSample
    Annotation that decorates an DefineKernelFunction annotation to provide examples of how to use the function. For example:
    
     @DefineSKFunction(
        name = "add",
        description = "Adds two numbers together",
        returnType = "java.lang.Integer",
        returnDescription = "The sum of the two numbers",
        samples = {
            @SKSample(inputs = "{\"number1\":1, \"number2\":2", output = "3")
         }
      )
     public static double add(
           @SKFunctionParameters(description="The first number to add", name="number1") double number1,
           @SKFunctionParameters(description="The second number to add", name="number2") double number2
       )
       {
           return number1 + number2;
       }
     
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String inputs
      An example of inputs to the function.
      String output
      An example output of the function given the inputs.
    • Element Detail

      • inputs

        String inputs
        An example of inputs to the function.
        Returns:
        An example of inputs to the function.
      • output

        String output
        An example output of the function given the inputs.
        Returns:
        An example output of the function given the inputs.