Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.ai.chatting.tasks

public Class GenerateRagResponseTask

extends BackgroundTask<ChatMessage>
Class Inheritance
Imports
java.util.ArrayList, .List, .Optional, org.jabref.logic.ai.chatting.ChatModel, org.jabref.logic.ai.chatting.util.ChatHistoryUtils, org.jabref.logic.ai.rag.logic.ResponseEngine, org.jabref.logic.ai.templates.AiTemplateRenderer, org.jabref.logic.l10n.Localization, org.jabref.logic.util.BackgroundTask, org.jabref.model.ai.chatting.ChatMessage, org.jabref.model.ai.identifiers.FullBibEntry, org.jabref.model.ai.pipeline.RelevantInformation, dev.langchain4j.model.chat.response.ChatResponse, org.slf4j.Logger, .LoggerFactory

The task responsible for generating a RAG (retrieval-augmented generation) response. Before sending a user message to the LLM, the ResponseEngine is called which finds the relevant context for the message.

Field Summary

Modifier and TypeField and Description
private final List<ChatMessage>
private final ChatModel
private final List<FullBibEntry>
private final String
private static final Logger
private final ResponseEngine
private final String

Constructor Summary

AccessConstructor and Description
public
GenerateRagResponseTask(ChatModel chatModel, ResponseEngine responseEngine, List<ChatMessage> chatHistory, List<FullBibEntry> entries, String systemMessageTemplate, String injectionTemplate)

Method Summary

Modifier and TypeMethod and Description
public ChatMessage
Inherited from org.jabref.logic.util.BackgroundTask:
cancelcancelconsumeOnRunningexecuteWithgetOnExceptiongetOnRunninggetOnSuccessgetProgressgetWorkDonePercentageisCancelledisCancelledPropertymayInterruptIfRunningPropertymessagePropertyonFailureonFinishedonRunningonSuccessprogressPropertyscheduleWithsetTitleshowToUsershowToUsershowToUserPropertythenthenRunthenRuntitlePropertyupdateMessageupdateProgressupdateProgresswillBeRecoveredAutomaticallywillBeRecoveredAutomaticallywithInitialMessageworkDonePercentagePropertywrapwrap

Field Detail

chatHistoryback to summary
private final List<ChatMessage> chatHistory
chatModelback to summary
private final ChatModel chatModel
entriesback to summary
private final List<FullBibEntry> entries
injectionTemplateback to summary
private final String injectionTemplate
LOGGERback to summary
private static final Logger LOGGER

Hides org.jabref.logic.util.BackgroundTask.LOGGER.

responseEngineback to summary
private final ResponseEngine responseEngine
systemMessageTemplateback to summary
private final String systemMessageTemplate

Constructor Detail

GenerateRagResponseTaskback to summary
public GenerateRagResponseTask(ChatModel chatModel, ResponseEngine responseEngine, List<ChatMessage> chatHistory, List<FullBibEntry> entries, String systemMessageTemplate, String injectionTemplate)

Method Detail

callback to summary
public ChatMessage call() throws Exception

Implements abstract org.jabref.logic.util.BackgroundTask.call.

Annotations
@Override