Package dev.langchain4j.data.message
Class ChatMessageDeserializer
-
- All Implemented Interfaces:
public class ChatMessageDeserializer
A deserializer for ChatMessage objects.
-
-
Method Summary
Modifier and Type Method Description static ChatMessage
messageFromJson(String json)
Deserializes a JSON string into a ChatMessage. static List<ChatMessage>
messagesFromJson(String json)
Deserializes a JSON string into a list of ChatMessage. -
-
Method Detail
-
messageFromJson
static ChatMessage messageFromJson(String json)
Deserializes a JSON string into a ChatMessage.
- Parameters:
json
- The JSON string representing a chat message.- Returns:
A ChatMessage deserialized from the provided JSON string.
-
messagesFromJson
static List<ChatMessage> messagesFromJson(String json)
Deserializes a JSON string into a list of ChatMessage.
- Parameters:
json
- The JSON string containing an array of chat messages.- Returns:
A list of ChatMessage deserialized from the provided JSON string.
-
-
-
-