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>
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 void
parseArgs
(org.apache.commons.cli.CommandLine cmdLine) Called directly after construction to pass runtime values that will override default values.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:DiarcComponent
Command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfo
in classDiarcComponent
- 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 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:
parseUtterance
in interfaceNLUInterface
- Parameters:
input
- The input Utterance to parse.- Returns:
- The parsed Utterance with updated semantic information.
-