Package dev.langchain4j.rag.query
Class Metadata
java.lang.Object
dev.langchain4j.rag.query.Metadata
Represents metadata that may be useful or necessary for retrieval or augmentation purposes.
-
Constructor Summary
ConstructorDescriptionMetadata
(UserMessage userMessage, Object chatMemoryId, List<ChatMessage> chatMemory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Metadata
from
(UserMessage userMessage, Object chatMemoryId, List<ChatMessage> chatMemory) int
hashCode()
toString()
-
Constructor Details
-
Metadata
-
-
Method Details
-
userMessage
- Returns:
- an original
UserMessage
passed to theRetrievalAugmentor.augment(UserMessage, Metadata)
.
-
chatMemoryId
- Returns:
- a chat memory ID. Present when
ChatMemory
is used. Can be used to distinguish between users. See@dev.langchain4j.service.MemoryId
annotation from adev.langchain4j:langchain4j
module.
-
chatMemory
- Returns:
- previous messages in the
ChatMemory
. Present whenChatMemory
is used. Can be used to get more details about the context (conversation) in which theQuery
originated.
-
equals
-
hashCode
public int hashCode() -
toString
-
from
public static Metadata from(UserMessage userMessage, Object chatMemoryId, List<ChatMessage> chatMemory)
-