Class ParamDescriptor

java.lang.Object
org.machanism.machai.ai.tools.ParamDescriptor

public class ParamDescriptor extends Object
Descriptor for a parameter used in tool or prompt definitions within the AI provider framework.

The ParamDescriptor class encapsulates metadata about a parameter, including its name, type, whether it is required, and a description of its purpose or usage.

  • name: The parameter's name.
  • type: The parameter's data type (e.g., "String", "Integer", "JsonNode").
  • required: Indicates whether the parameter is mandatory.
  • description: A brief description of the parameter's purpose or usage.

This class is typically used to document and validate parameters for tool functions, prompts, or other callable entities within the framework.

  • Field Details

    • name

      String name
      The parameter's name.
    • type

      String type
      The parameter's data type.
    • required

      boolean required
      Indicates whether the parameter is required.
    • description

      String description
      Description of the parameter's purpose or usage.
  • Constructor Details

    • ParamDescriptor

      public ParamDescriptor(String name, String type, boolean required, String description)
      Constructs a new ParamDescriptor with the specified properties.
      Parameters:
      name - the parameter's name
      type - the parameter's data type
      required - whether the parameter is mandatory
      description - a brief description of the parameter's purpose or usage
  • Method Details

    • getName

      public String getName()
      Returns the parameter's name.
      Returns:
      the name of the parameter
    • getType

      public String getType()
      Returns the parameter's data type.
      Returns:
      the data type of the parameter
    • getDescription

      public String getDescription()
      Returns a description of the parameter's purpose or usage.
      Returns:
      the parameter description
    • isRequired

      public boolean isRequired()
      Indicates whether the parameter is required.
      Returns:
      true if the parameter is mandatory; false otherwise