Package edu.tufts.hrilab.llm.hf
Class SpotPickAndPlaceLLMServiceProvider
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.llm.hf.LLMServiceProvider
edu.tufts.hrilab.llm.hf.SpotPickAndPlaceLLMServiceProvider
- All Implemented Interfaces:
NLGInterface
-
Field Summary
Fields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ChatgenerateNLGChat(Utterance utterance, List<Utterance> conversationHistory) Generate a Chat object to call LLM's chatCompletion service with for the generation task.protected ChatgenerateNLUChat(Utterance utterance, Chat currentChat, List<Utterance> conversationHistory) Generate a Chat object to call LLM's chatCompletion service with for the parsing task.parseNLGCompletionResponse(Utterance outgoingUtterance, Completion llmResponse) Postprocessing of LLM's chatCompletion return value for the NLG task.parseNLUCompletionResponse(Utterance incomingUtterance, Completion llmResponse) Postprocessing of LLM's chatCompletion return value for the NLU task.Methods inherited from class edu.tufts.hrilab.llm.hf.LLMServiceProvider
clearConversationHistory, convertSemanticsToText, endLLMChatContext, endLLMConversation, endLLMConversation, endLLMConversation, endLLMConversation, executionLoop, getDescendants, getUntypedSymbol, init, llmGenerationService, parseUtterance, startLLMChatContext, startLLMConversation, startLLMConversation, startLLMConversation, toggleLLMNLG, updateLLMConversationHistoryMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
additionalUsageInfo, attachShutdownHook, createInstance, createInstance, createInstance, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, parseArgs, postRegistrationInit, shutdown, shutdownComponent
-
Constructor Details
-
SpotPickAndPlaceLLMServiceProvider
public SpotPickAndPlaceLLMServiceProvider()
-
-
Method Details
-
parseNLUCompletionResponse
Description copied from class:LLMServiceProviderPostprocessing of LLM's chatCompletion return value for the NLU task.- Specified by:
parseNLUCompletionResponsein classLLMServiceProvider- Returns:
- The fully populated Utterance to return from parseUtterance
-
parseNLGCompletionResponse
Description copied from class:LLMServiceProviderPostprocessing of LLM's chatCompletion return value for the NLG task.- Specified by:
parseNLGCompletionResponsein classLLMServiceProvider- Returns:
- The fully populated Utterance to return convertSemanticsToText.
-
generateNLGChat
Description copied from class:LLMServiceProviderGenerate 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.- Specified by:
generateNLGChatin classLLMServiceProvider- Parameters:
utterance- outgoing utterance to perform NLG forconversationHistory- Relevant dialogue history leading up to this outgoing utterance which may provide context.- Returns:
- Fully updated Chat object to pass to an LLM's chatCompletion service for NLG
-
generateNLUChat
protected Chat generateNLUChat(Utterance utterance, Chat currentChat, List<Utterance> conversationHistory) Description copied from class:LLMServiceProviderGenerate 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.- Specified by:
generateNLUChatin classLLMServiceProvider- Parameters:
utterance- incoming utterance to be parsedcurrentChat- Chat object containing prior requests and responses between the LLM for this current parse attempt. Null if this is the first interaction.conversationHistory- Relevant dialogue history leading up to this incoming utterance which may provide context.- Returns:
- Fully updated Chat object to pass to an LLM's chatCompletion service for parsing
-