Uses of Interface
dev.langchain4j.data.message.ChatMessage
Packages that use ChatMessage
Package
Description
-
Uses of ChatMessage in dev.langchain4j.data.message
Classes in dev.langchain4j.data.message that implement ChatMessageModifier and TypeClassDescriptionclassRepresents a message generated by AI (language model).classRepresents a custom message.classRepresents a system message, typically defined by a developer.classRepresents the result of a tool execution in response to aToolExecutionRequest.classRepresents a message from a user, typically an end user of the application.Methods in dev.langchain4j.data.message that return ChatMessageModifier and TypeMethodDescriptionstatic ChatMessageChatMessageDeserializer.messageFromJson(String json) Deserializes a JSON string into aChatMessage.ChatMessageJsonCodec.messageFromJson(String json) Deserializes a JSON string to aChatMessageobject.JacksonChatMessageJsonCodec.messageFromJson(String json) Methods in dev.langchain4j.data.message that return types with arguments of type ChatMessageModifier and TypeMethodDescriptionClass<? extends ChatMessage> ChatMessageType.messageClass()Returns the class of the message type.static List<ChatMessage> ChatMessageDeserializer.messagesFromJson(String json) Deserializes a JSON string into a list ofChatMessage.ChatMessageJsonCodec.messagesFromJson(String json) Deserializes a JSON string to a list ofChatMessageobjects.JacksonChatMessageJsonCodec.messagesFromJson(String json) Methods in dev.langchain4j.data.message with parameters of type ChatMessageModifier and TypeMethodDescriptionChatMessageJsonCodec.messageToJson(ChatMessage message) Serializes aChatMessageobject to a JSON string.static StringChatMessageSerializer.messageToJson(ChatMessage message) Serializes a chat message into a JSON string.JacksonChatMessageJsonCodec.messageToJson(ChatMessage message) Method parameters in dev.langchain4j.data.message with type arguments of type ChatMessageModifier and TypeMethodDescriptionstatic List<SystemMessage> SystemMessage.findAll(List<ChatMessage> messages) static Optional<SystemMessage> SystemMessage.findFirst(List<ChatMessage> messages) static Optional<SystemMessage> SystemMessage.findLast(List<ChatMessage> messages) ChatMessageJsonCodec.messagesToJson(List<ChatMessage> messages) Serializes a list ofChatMessageobjects to a JSON string.static StringChatMessageSerializer.messagesToJson(List<ChatMessage> messages) Serializes a list of chat messages into a JSON string.JacksonChatMessageJsonCodec.messagesToJson(List<ChatMessage> messages) -
Uses of ChatMessage in dev.langchain4j.guardrail
Method parameters in dev.langchain4j.guardrail with type arguments of type ChatMessageModifier and TypeMethodDescriptionChatExecutor.execute(List<ChatMessage> chatMessages) Executes a chat request using the provided chat messages -
Uses of ChatMessage in dev.langchain4j.internal
Method parameters in dev.langchain4j.internal with type arguments of type ChatMessageModifier and TypeMethodDescriptionstatic voidChatRequestValidationUtils.validateMessages(List<ChatMessage> messages) -
Uses of ChatMessage in dev.langchain4j.memory
Methods in dev.langchain4j.memory that return types with arguments of type ChatMessageMethods in dev.langchain4j.memory with parameters of type ChatMessageModifier and TypeMethodDescriptionvoidChatMemory.add(ChatMessage message) Adds a message to the chat memory.default voidChatMemory.add(ChatMessage... messages) Adds messages to the chat memoryMethod parameters in dev.langchain4j.memory with type arguments of type ChatMessageModifier and TypeMethodDescriptiondefault voidChatMemory.add(Iterable<ChatMessage> messages) Adds messages to the chat memory -
Uses of ChatMessage in dev.langchain4j.model
Methods in dev.langchain4j.model with parameters of type ChatMessageModifier and TypeMethodDescriptionintTokenCountEstimator.estimateTokenCountInMessage(ChatMessage message) Estimates the count of tokens in the given message.Method parameters in dev.langchain4j.model with type arguments of type ChatMessageModifier and TypeMethodDescriptionintTokenCountEstimator.estimateTokenCountInMessages(Iterable<ChatMessage> messages) Estimates the count of tokens in the given messages. -
Uses of ChatMessage in dev.langchain4j.model.chat
Methods in dev.langchain4j.model.chat with parameters of type ChatMessageMethod parameters in dev.langchain4j.model.chat with type arguments of type ChatMessageModifier and TypeMethodDescriptiondefault ChatResponseChatModel.chat(List<ChatMessage> messages) default voidStreamingChatModel.chat(List<ChatMessage> messages, StreamingChatResponseHandler handler) -
Uses of ChatMessage in dev.langchain4j.model.chat.request
Methods in dev.langchain4j.model.chat.request that return types with arguments of type ChatMessageMethods in dev.langchain4j.model.chat.request with parameters of type ChatMessageMethod parameters in dev.langchain4j.model.chat.request with type arguments of type ChatMessage -
Uses of ChatMessage in dev.langchain4j.model.moderation
Methods in dev.langchain4j.model.moderation with parameters of type ChatMessageModifier and TypeMethodDescriptionDisabledModerationModel.moderate(ChatMessage message) default Response<Moderation> ModerationModel.moderate(ChatMessage message) Moderates the given chat message.Method parameters in dev.langchain4j.model.moderation with type arguments of type ChatMessageModifier and TypeMethodDescriptionDisabledModerationModel.moderate(List<ChatMessage> messages) ModerationModel.moderate(List<ChatMessage> messages) Moderates the given list of chat messages. -
Uses of ChatMessage in dev.langchain4j.rag
Methods in dev.langchain4j.rag that return ChatMessageModifier and TypeMethodDescriptionAugmentationRequest.chatMessage()AugmentationResult.chatMessage()Methods in dev.langchain4j.rag with parameters of type ChatMessageModifier and TypeMethodDescriptionAugmentationResult.AugmentationResultBuilder.chatMessage(ChatMessage chatMessage) Constructors in dev.langchain4j.rag with parameters of type ChatMessageModifierConstructorDescriptionAugmentationRequest(ChatMessage chatMessage, Metadata metadata) AugmentationResult(ChatMessage chatMessage, List<Content> contents) -
Uses of ChatMessage in dev.langchain4j.rag.content.injector
Methods in dev.langchain4j.rag.content.injector that return ChatMessageModifier and TypeMethodDescriptionContentInjector.inject(List<Content> contents, ChatMessage chatMessage) Injects givenContents into a givenChatMessage.DefaultContentInjector.inject(List<Content> contents, ChatMessage chatMessage) Methods in dev.langchain4j.rag.content.injector with parameters of type ChatMessageModifier and TypeMethodDescriptionprotected PromptDefaultContentInjector.createPrompt(ChatMessage chatMessage, List<Content> contents) ContentInjector.inject(List<Content> contents, ChatMessage chatMessage) Injects givenContents into a givenChatMessage.DefaultContentInjector.inject(List<Content> contents, ChatMessage chatMessage) -
Uses of ChatMessage in dev.langchain4j.rag.query
Methods in dev.langchain4j.rag.query that return ChatMessageMethods in dev.langchain4j.rag.query that return types with arguments of type ChatMessageMethods in dev.langchain4j.rag.query with parameters of type ChatMessageModifier and TypeMethodDescriptionMetadata.Builder.chatMessage(ChatMessage chatMessage) static MetadataMetadata.from(ChatMessage chatMessage, Object chatMemoryId, List<ChatMessage> chatMemory) Method parameters in dev.langchain4j.rag.query with type arguments of type ChatMessageModifier and TypeMethodDescriptionMetadata.Builder.chatMemory(List<ChatMessage> chatMemory) static MetadataMetadata.from(ChatMessage chatMessage, Object chatMemoryId, List<ChatMessage> chatMemory) Constructors in dev.langchain4j.rag.query with parameters of type ChatMessageModifierConstructorDescriptionMetadata(ChatMessage chatMessage, Object chatMemoryId, List<ChatMessage> chatMemory) Constructor parameters in dev.langchain4j.rag.query with type arguments of type ChatMessageModifierConstructorDescriptionMetadata(ChatMessage chatMessage, Object chatMemoryId, List<ChatMessage> chatMemory) -
Uses of ChatMessage in dev.langchain4j.rag.query.transformer
Methods in dev.langchain4j.rag.query.transformer with parameters of type ChatMessageModifier and TypeMethodDescriptionprotected StringCompressingQueryTransformer.format(ChatMessage message) Method parameters in dev.langchain4j.rag.query.transformer with type arguments of type ChatMessageModifier and TypeMethodDescriptionprotected StringCompressingQueryTransformer.format(List<ChatMessage> chatMemory) -
Uses of ChatMessage in dev.langchain4j.store.memory.chat
Methods in dev.langchain4j.store.memory.chat that return types with arguments of type ChatMessageModifier and TypeMethodDescriptionChatMemoryStore.getMessages(Object memoryId) Retrieves messages for a specified chat memory.InMemoryChatMemoryStore.getMessages(Object memoryId) Method parameters in dev.langchain4j.store.memory.chat with type arguments of type ChatMessageModifier and TypeMethodDescriptionvoidChatMemoryStore.updateMessages(Object memoryId, List<ChatMessage> messages) Updates messages for a specified chat memory.voidInMemoryChatMemoryStore.updateMessages(Object memoryId, List<ChatMessage> messages)