Class AvaLLMServiceProvider
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.AvaLLMServiceProvider
-
Field Summary
Fields inherited from class edu.tufts.hrilab.llm.serviceproviders.tr.TRLLMServiceProvider
language, learnedActionNames, learnedActionsString, 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 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.protected Promptprotected Promptprotected Promptprotected Promptprotected Promptprotected Promptprotected voidinit()Perform any component initialization.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, handleDatabaseAddition, 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
additionalUsageInfo, attachShutdownHook, createInstance, createInstance, createInstance, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, parseArgs, postRegistrationInit, shutdown
-
Constructor Details
-
AvaLLMServiceProvider
public AvaLLMServiceProvider()
-
-
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
-
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
-
getRefTypes
- Specified by:
getRefTypesin classTRLLMServiceProvider
-
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
-
getInstructableActions
-