Interface RetrievalAugmentedEvent
- All Superinterfaces:
AiServiceEvent
- All Known Implementing Classes:
DefaultRetrievalAugmentedEvent
Invoked once per invocation of an AI Service that uses retrieval-augmented generation (RAG), configured with
contentRetriever(...) or retrievalAugmentor(...), after the contents to add to the user message were
retrieved, also when nothing was retrieved. It carries the user message that was used for the retrieval (the chat
message given to the RetrievalAugmentor) and the final contents, after all queries, retrievers, aggregation
and re-ranking. To observe each
ContentRetriever call separately, with the query it received, use a
ContentRetrieverListener.- Since:
- 1.23.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface AiServiceEvent
AiServiceEvent.Builder<T> -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns the chat message given to theRetrievalAugmentor(seeAugmentationRequest.chatMessage()), before the retrieved contents were added to it.contents()Returns the retrieved contents: the same contents that an AI Service method returningResult<...>gives as its sources.default Class<RetrievalAugmentedEvent> Retrieves the class type of the event, representing the specific category of the AI Service invocation event.Creates a new builder instance initialized with the properties of thisAiServiceEvent.Methods inherited from interface AiServiceEvent
invocationContext
-
Method Details
-
chatMessage
ChatMessage chatMessage()Returns the chat message given to theRetrievalAugmentor(seeAugmentationRequest.chatMessage()), before the retrieved contents were added to it. In AI Services this is the user message. It is the input of retrieval, not the queries sent to the content retrievers: the retrieval augmentor can transform it into one or more different queries first.- Returns:
- the chat message given to the retrieval augmentor, never
null
-
contents
-
eventClass
Description copied from interface:AiServiceEventRetrieves the class type of the event, representing the specific category of the AI Service invocation event.- Specified by:
eventClassin interfaceAiServiceEvent
-
toBuilder
Description copied from interface:AiServiceEventCreates a new builder instance initialized with the properties of thisAiServiceEvent. This allows modification of the existing properties and reconstruction of the event.- Specified by:
toBuilderin interfaceAiServiceEvent
-
builder
-