Class PickAndPlace2024LLMServiceProvider
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.llm.LLMServiceProvider
edu.tufts.hrilab.llm.serviceproviders.BasicLLMServiceProvider
edu.tufts.hrilab.llm.serviceproviders.tr.TRLLMServiceProvider
edu.tufts.hrilab.llm.serviceproviders.tr.PickAndPlace2024LLMServiceProvider
-
Field Summary
Fields inherited from class edu.tufts.hrilab.llm.serviceproviders.tr.TRLLMServiceProvider
language, learnedActionNames, processMatchingNLUParseLiteralsAsRefsFields inherited from class edu.tufts.hrilab.llm.LLMServiceProvider
agentHierarchy, conversationMappings, counter, currentConversations, learnedActions, trackDialogueHistory, trackLearnedActionsFields 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.protected UtterancecorrectCommonNLUMistakes(Utterance utterance) Domain specific postprocessing on NLU completions.protected StringgetDescriptorType(String agentName, String descriptor) Used during NLU postprocessing - Check if the supplied descriptor matches any known references in the system.getJapaneseVersionOfDescriptor(Symbol descriptor) getJapaneseVersionOfDescriptor(String descriptorString) protected Promptprotected Promptprotected Promptprotected Promptprotected Promptprotected Promptvoidprotected voidinit()Perform any component initialization.protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class.populatePromptVars(Utterance utterance, Map<String, String> promptVars, boolean system, boolean parsing, boolean validation) Return prompt variables relevant for the associated Prompt to be included in an upcoming request.Methods inherited from class edu.tufts.hrilab.llm.serviceproviders.tr.TRLLMServiceProvider
generateNLGChat, generateNLUChat, getConversationHistoryString, getCurrentGoals, getCurrentGoalsSummary, getCurrentQuestionsString, handleDatabaseRemoval, initLearnedActions, parseNLGCompletionResponse, parseNLUCompletionResponse, processSemantics, testLLMNLGWithStringMethods inherited from class edu.tufts.hrilab.llm.serviceproviders.BasicLLMServiceProvider
convertSemanticsToTextLLMService, convertSemanticsToTextLLMService, inExtendedParseLoop, llmChatCompletionHelper, parseUtteranceLLMService, parseUtteranceLLMServiceMethods inherited from class edu.tufts.hrilab.llm.LLMServiceProvider
callChatEndpoint, clearConversationHistory, endLLMConversation, endLLMConversation, endLLMConversation, endLLMConversation, executionLoop, getConversationHistory, getConversationHistory, getDescendants, getLLMConversationLength, getUntypedSymbol, registerForNotifications, setLanguage, shutdownComponent, startLLMConversation, startLLMConversation, startLLMConversation, updateLLMConversationHistoryMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
attachShutdownHook, createInstance, createInstance, createInstance, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, postRegistrationInit, shutdown
-
Constructor Details
-
PickAndPlace2024LLMServiceProvider
public PickAndPlace2024LLMServiceProvider()
-
-
Method Details
-
init
protected void init()Description copied from class:DiarcComponentPerform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.- Overrides:
initin classTRLLMServiceProvider
-
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
-
getRefTypes
- Specified by:
getRefTypesin classTRLLMServiceProvider
-
getNluSystemPrompt
- Specified by:
getNluSystemPromptin classTRLLMServiceProvider
-
getNluUserPrompt
- Specified by:
getNluUserPromptin classTRLLMServiceProvider
-
getNlgSystemPrompt
- Specified by:
getNlgSystemPromptin classTRLLMServiceProvider
-
getNlgUserPrompt
- Specified by:
getNlgUserPromptin classTRLLMServiceProvider
-
getValidationSystemPrompt
- Specified by:
getValidationSystemPromptin classTRLLMServiceProvider
-
getValidationUserPrompt
- Specified by:
getValidationUserPromptin classTRLLMServiceProvider
-
populatePromptVars
protected Map<String,String> populatePromptVars(Utterance utterance, Map<String, String> promptVars, boolean system, boolean parsing, boolean validation) Description copied from class:TRLLMServiceProviderReturn prompt variables relevant for the associated Prompt to be included in an upcoming request. Refer to the Prompt class and apply method if this notion is unfamiliar to you. These details may be generated on each request, or constantly updated in the background and provided to requests from this method. Please explicitly incorporate, overwrite, or discard information supplied in the passed in promptVars.- Specified by:
populatePromptVarsin classTRLLMServiceProvider- Parameters:
utterance- - The input/output utterance associated with this requestpromptVars- - Default prompt variables containing common system information gathered in LLMServiceProvidersystem- - Whether these variables are being applied to the system message or user messageparsing- - Whether this call is part of an NLU or NLG requestvalidation- - (NLG Only) whether this call is associated with a system validation question- Returns:
- The variables to apply to the associated prompt in an upcoming request
-
correctCommonNLUMistakes
Description copied from class:TRLLMServiceProviderDomain specific postprocessing on NLU completions. Simply return supplied utterance if you have no domain specific postprocessing.- Specified by:
correctCommonNLUMistakesin classTRLLMServiceProvider
-
getDescriptorType
Description copied from class:TRLLMServiceProviderUsed during NLU postprocessing - Check if the supplied descriptor matches any known references in the system. Return the associated reference's type (the descriptor will be typed replaced with a variable to later be dereferenced) Return an empty string if no match is found or you do not desire this functionality.- Specified by:
getDescriptorTypein classTRLLMServiceProvider
-
getJapaneseVersionOfDescriptor
-
getJapaneseVersionOfDescriptor
-
handleDatabaseAddition
public void handleDatabaseAddition(ActionDBEntry entry) throws ai.thinkingrobots.trade.TRADEException - Overrides:
handleDatabaseAdditionin classTRLLMServiceProvider- Throws:
ai.thinkingrobots.trade.TRADEException
-