Class LLMParserComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.slug.parsing.llm.LLMParserComponent
- All Implemented Interfaces:
NLUInterface
-
Field Summary
FieldsFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>Override this method to define command line options available in sub-class.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.protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class.parseUtterance(Utterance input) Parses the input Utterance to obtain semantic information.Methods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, init, main, shutdown, shutdownComponent
-
Field Details
-
endpoint
-
-
Constructor Details
-
LLMParserComponent
public LLMParserComponent()
-
-
Method Details
-
additionalUsageInfo
Description copied from class:DiarcComponentOverride this method to define command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfoin classDiarcComponent- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponentOverride this method to parse command line args in the sub-class. Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.- Overrides:
parseArgsin classDiarcComponent
-
getResponse
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
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:
parseUtterancein interfaceNLUInterface- Parameters:
input- The input Utterance to parse.- Returns:
- The parsed Utterance with updated semantic information.
-