Package dev.langchain4j.data.message
Class ChatMessageDeserializer
java.lang.Object
dev.langchain4j.data.message.ChatMessageDeserializer
A deserializer for
ChatMessage
objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic ChatMessage
messageFromJson
(String json) Deserializes a JSON string into aChatMessage
.static List
<ChatMessage> messagesFromJson
(String json) Deserializes a JSON string into a list ofChatMessage
.
-
Method Details
-
messageFromJson
Deserializes a JSON string into aChatMessage
.- Parameters:
json
- The JSON string representing a chat message.- Returns:
- A
ChatMessage
deserialized from the provided JSON string. - See Also:
-
messagesFromJson
Deserializes a JSON string into a list ofChatMessage
.- Parameters:
json
- The JSON string containing an array of chat messages.- Returns:
- A list of
ChatMessage
deserialized from the provided JSON string. - See Also:
-