Class BasicLLMServiceProvider
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.llm.LLMServiceProvider
edu.tufts.hrilab.llm.serviceproviders.BasicLLMServiceProvider
- Direct Known Subclasses:
TRLLMServiceProvider
-
Field Summary
Fields inherited from class edu.tufts.hrilab.llm.LLMServiceProvider
agentHierarchy, conversationMappings, counter, currentConversations, language, learnedActions, trackDialogueHistory, trackLearnedActionsFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertSemanticsToTextLLMService(Utterance utterance, boolean streamingGeneration) protected abstract ChatgenerateNLGChat(Utterance utterance) Generate a Chat object to call LLM's chatCompletion service with for the generation task.protected abstract ChatgenerateNLUChat(Utterance utterance) Generate a Chat object to call LLM's chatCompletion service with for the parsing task.booleaninExtendedParseLoop(Symbol user, Symbol agentTeam) protected UtterancellmChatCompletionHelper(Utterance utterance, boolean parsing) protected abstract UtteranceparseNLGCompletionResponse(Utterance outgoingUtterance, Completion llmResponse) Postprocessing of LLM's chatCompletion return value for the NLG task.protected abstract UtteranceparseNLUCompletionResponse(Utterance incomingUtterance, Completion llmResponse) Postprocessing of LLM's chatCompletion return value for the NLU task.parseUtteranceLLMService(Utterance utterance) parseUtteranceLLMService(Utterance utterance, boolean streamingGeneration) Methods inherited from class edu.tufts.hrilab.llm.LLMServiceProvider
callChatEndpoint, clearConversationHistory, endLLMConversation, endLLMConversation, endLLMConversation, endLLMConversation, executionLoop, getConversationHistory, getConversationHistory, getDescendants, getLLMConversationLength, getUntypedSymbol, handleDatabaseAddition, handleDatabaseRemoval, init, initLearnedActions, 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
-
BasicLLMServiceProvider
public BasicLLMServiceProvider()
-
-
Method Details
-
generateNLGChat
Generate a Chat object to call LLM's chatCompletion service with for the generation task. Practically entails generating a system and user message for an NLG request of the supplied utterance.- Parameters:
utterance- outgoing utterance to perform NLG for- Returns:
- Fully updated Chat object to pass to an LLM's chatCompletion service for NLG
-
generateNLUChat
Generate a Chat object to call LLM's chatCompletion service with for the parsing task. Practically entails creating a new or updating an existing Chat object to contain the proper system, user, and assistant messages to come up with a proper parse of the supplied utterance.- Parameters:
utterance- incoming utterance to be parsed- Returns:
- Fully updated Chat object to pass to an LLM's chatCompletion service for parsing
-
parseNLUCompletionResponse
protected abstract Utterance parseNLUCompletionResponse(Utterance incomingUtterance, Completion llmResponse) Postprocessing of LLM's chatCompletion return value for the NLU task.- Returns:
- The fully populated Utterance to return from parseUtterance
-
parseNLGCompletionResponse
protected abstract Utterance parseNLGCompletionResponse(Utterance outgoingUtterance, Completion llmResponse) Postprocessing of LLM's chatCompletion return value for the NLG task.- Returns:
- The fully populated Utterance to return convertSemanticsToText.
-
inExtendedParseLoop
- Specified by:
inExtendedParseLoopin classLLMServiceProvider
-
parseUtteranceLLMService
- Specified by:
parseUtteranceLLMServicein classLLMServiceProvider
-
convertSemanticsToTextLLMService
- Specified by:
convertSemanticsToTextLLMServicein classLLMServiceProvider
-
convertSemanticsToTextLLMService
- Specified by:
convertSemanticsToTextLLMServicein classLLMServiceProvider
-
parseUtteranceLLMService
- Specified by:
parseUtteranceLLMServicein classLLMServiceProvider
-
llmChatCompletionHelper
-