Class LLMParserComponent

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.slug.parsing.llm.LLMParserComponent
All Implemented Interfaces:
NLUInterface

public class LLMParserComponent extends DiarcComponent implements NLUInterface
  • Field Details

    • endpoint

      public String endpoint
  • Constructor Details

    • LLMParserComponent

      public LLMParserComponent()
  • Method Details

    • additionalUsageInfo

      protected List<org.apache.commons.cli.Option> additionalUsageInfo()
      Description copied from class: DiarcComponent
      Command line options available in sub-class. This should be paired with a parseArgs implementation.
      Overrides:
      additionalUsageInfo in class DiarcComponent
      Returns:
    • parseArgs

      protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine)
      Description copied from class: DiarcComponent
      Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs
      Overrides:
      parseArgs in class DiarcComponent
    • getResponse

      public ParserResponse getResponse(String input)
      Sends a POST request to the specified endpoint with the given input as the request body and retrieves the response as a ParserResponse object.
      Parameters:
      input - The input string to be sent in the request body.
      Returns:
      The ParserResponse object obtained from the response.
    • parseUtterance

      public Utterance parseUtterance(Utterance input)
      Parses the input Utterance to obtain semantic information. Optionally use a TRADEService defined in the service property. Default behavior is to use getResponse() to retrieve from parser service.
      Specified by:
      parseUtterance in interface NLUInterface
      Parameters:
      input - The input Utterance to parse.
      Returns:
      The parsed Utterance with updated semantic information.