Package | Description |
---|---|
dev.langchain4j.data.message | |
dev.langchain4j.memory | |
dev.langchain4j.model | |
dev.langchain4j.model.chat | |
dev.langchain4j.model.moderation | |
dev.langchain4j.store.memory.chat |
Modifier and Type | Class and Description |
---|---|
class |
AiMessage
Represents a response message from an AI (language model).
|
class |
SystemMessage
Represents a system message, typically defined by a developer.
|
class |
ToolExecutionResultMessage
Represents the result of a tool execution.
|
class |
UserMessage
Represents a message from a user, typically an end user of the application.
|
Modifier and Type | Method and Description |
---|---|
static ChatMessage |
ChatMessageDeserializer.messageFromJson(String json)
Deserializes a JSON string into a
ChatMessage . |
Modifier and Type | Method and Description |
---|---|
static Class<? extends ChatMessage> |
ChatMessageType.classOf(ChatMessageType type) |
static List<ChatMessage> |
ChatMessageDeserializer.messagesFromJson(String json)
Deserializes a JSON string into a list of
ChatMessage . |
Modifier and Type | Method and Description |
---|---|
static String |
ChatMessageSerializer.messageToJson(ChatMessage message)
Serializes a chat message into a JSON string.
|
Modifier and Type | Method and Description |
---|---|
static String |
ChatMessageSerializer.messagesToJson(List<ChatMessage> messages)
Serializes a list of chat messages into a JSON string.
|
Modifier and Type | Method and Description |
---|---|
List<ChatMessage> |
ChatMemory.messages()
Retrieves messages from the chat memory.
|
Modifier and Type | Method and Description |
---|---|
void |
ChatMemory.add(ChatMessage message)
Adds a message to the chat memory.
|
Modifier and Type | Method and Description |
---|---|
int |
Tokenizer.estimateTokenCountInMessage(ChatMessage message) |
Modifier and Type | Method and Description |
---|---|
int |
Tokenizer.estimateTokenCountInMessages(Iterable<ChatMessage> messages) |
Modifier and Type | Method and Description |
---|---|
default Response<AiMessage> |
ChatLanguageModel.generate(ChatMessage... messages)
Generates a response from the model based on a sequence of messages.
|
Modifier and Type | Method and Description |
---|---|
int |
TokenCountEstimator.estimateTokenCount(List<ChatMessage> messages) |
Response<AiMessage> |
ChatLanguageModel.generate(List<ChatMessage> messages)
Generates a response from the model based on a sequence of messages.
|
Response<AiMessage> |
ChatLanguageModel.generate(List<ChatMessage> messages,
List<ToolSpecification> toolSpecifications)
Generates a response from the model based on a list of messages and a list of tool specifications.
|
void |
StreamingChatLanguageModel.generate(List<ChatMessage> messages,
List<ToolSpecification> toolSpecifications,
StreamingResponseHandler<AiMessage> handler)
Generates a response from the model based on a list of messages and a list of tool specifications.
|
void |
StreamingChatLanguageModel.generate(List<ChatMessage> messages,
StreamingResponseHandler<AiMessage> handler)
Generates a response from the model based on a sequence of messages.
|
Response<AiMessage> |
ChatLanguageModel.generate(List<ChatMessage> messages,
ToolSpecification toolSpecification)
Generates a response from the model based on a list of messages and a single tool specification.
|
void |
StreamingChatLanguageModel.generate(List<ChatMessage> messages,
ToolSpecification toolSpecification,
StreamingResponseHandler<AiMessage> handler) |
Modifier and Type | Method and Description |
---|---|
Response<Moderation> |
ModerationModel.moderate(ChatMessage message) |
Modifier and Type | Method and Description |
---|---|
Response<Moderation> |
ModerationModel.moderate(List<ChatMessage> messages) |
Modifier and Type | Method and Description |
---|---|
List<ChatMessage> |
InMemoryChatMemoryStore.getMessages(Object memoryId) |
List<ChatMessage> |
ChatMemoryStore.getMessages(Object memoryId)
Retrieves messages for a specified chat memory.
|
Modifier and Type | Method and Description |
---|---|
void |
InMemoryChatMemoryStore.updateMessages(Object memoryId,
List<ChatMessage> messages) |
void |
ChatMemoryStore.updateMessages(Object memoryId,
List<ChatMessage> messages)
Updates messages for a specified chat memory.
|
Copyright © 2023. All rights reserved.