Class EntityGeneratorWrapper


public class EntityGeneratorWrapper extends GeneratorWrapper<EntityGeneratorProcessor>
Wrapper class for the EntityGeneratorProcessor. This class is responsible for managing the entity generation process. It provides methods to generate entities and interact with a Large Language Model (LLM) for entity generation.
  • Field Details

  • Constructor Details

    • EntityGeneratorWrapper

      public EntityGeneratorWrapper(ProcessorFactory processorFactory, EntityGeneratorProcessor processor, Map<String,Object> parameters)
      Constructs a new EntityGeneratorWrapper with the specified processor factory, processor, and parameters.
      Parameters:
      processorFactory - the processor factory to use
      processor - the entity generator processor
      parameters - the parameters to set in the processor
  • Method Details

    • generateEntity

      public EntityInstance generateEntity()
      Generates an entity instance. This function is called multiple times to generate a new entity. The generated value must be returned. The returned value must be an instance of EntityInstance. Use the buildEntity() method to create an instance.
      Returns:
      the generated entity instance
    • buildEntity

      public EntityInstance buildEntity(Map<String,AttributeGeneratorProcessor> attributeGenerators)
      Builds an entity instance using the provided attribute generators.
      Parameters:
      attributeGenerators - the attribute generators to use
      Returns:
      the built entity instance
    • llm

      public EntityInstance llm()
      This method calls an LLM (Large Language Model) to generate entity instances.
      Returns:
      the generated entity instance
      See Also:
    • llm

      public EntityInstance llm(int n, String instructions, Map<String,String> attributeInstructions)
      This method calls an LLM (Large Language Model) to generate entity instances. The method uses descriptions of the domain entity and its attributes to guide the LLM. Additional instructions can be provided to this function guide the LLM.
      Parameters:
      n - the number of entity instances to generate with one LLM call.
      instructions - Additional instructions added to the prompt to guide the LLM.
      attributeInstructions - Additional instructions for each attribute to guide the LLM.
      Returns:
      the generated entity instances