Package dev.langchain4j.rag.query
Class Metadata
-
- All Implemented Interfaces:
public class Metadata
Represents metadata that may be useful or necessary for retrieval or augmentation purposes.
-
-
Constructor Summary
Constructors Constructor Description Metadata(UserMessage userMessage, Object chatMemoryId, List<ChatMessage> chatMemory)
-
Method Summary
Modifier and Type Method Description UserMessage
userMessage()
Object
chatMemoryId()
List<ChatMessage>
chatMemory()
boolean
equals(Object o)
int
hashCode()
String
toString()
static Metadata
from(UserMessage userMessage, Object chatMemoryId, List<ChatMessage> chatMemory)
-
-
Constructor Detail
-
Metadata
Metadata(UserMessage userMessage, Object chatMemoryId, List<ChatMessage> chatMemory)
-
-
Method Detail
-
userMessage
UserMessage userMessage()
- Returns:
an original UserMessage passed to the augment.
-
chatMemoryId
Object 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
List<ChatMessage> chatMemory()
- Returns:
previous messages in the ChatMemory. Present when ChatMemory is used. Can be used to get more details about the context (conversation) in which the Query originated.
-
hashCode
int hashCode()
-
from
static Metadata from(UserMessage userMessage, Object chatMemoryId, List<ChatMessage> chatMemory)
-
-
-
-