Class AiMessageSerializer
java.lang.Object
org.bsc.langgraph4j.langchain4j.serializer.std.AiMessageSerializer
- All Implemented Interfaces:
Serializer<dev.langchain4j.data.message.AiMessage>
public class AiMessageSerializer
extends Object
implements Serializer<dev.langchain4j.data.message.AiMessage>
The AiMessageSerializer class implements the Serializer interface for the AiMessage type.
It provides methods to serialize and deserialize AiMessage objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondev.langchain4j.data.message.AiMessageread(ObjectInput in) Deserializes an AiMessage object from the specified input stream.voidwrite(dev.langchain4j.data.message.AiMessage object, ObjectOutput out) Serializes the given AiMessage object to the specified output stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bsc.langgraph4j.serializer.Serializer
cloneObject, mimeType, readObject, writeObject
-
Constructor Details
-
AiMessageSerializer
public AiMessageSerializer()
-
-
Method Details
-
write
public void write(dev.langchain4j.data.message.AiMessage object, ObjectOutput out) throws IOException Serializes the given AiMessage object to the specified output stream.- Specified by:
writein interfaceSerializer<dev.langchain4j.data.message.AiMessage>- Parameters:
object- the AiMessage object to serializeout- the output stream to write the serialized object to- Throws:
IOException- if an I/O error occurs during serialization
-
read
public dev.langchain4j.data.message.AiMessage read(ObjectInput in) throws IOException, ClassNotFoundException Deserializes an AiMessage object from the specified input stream.- Specified by:
readin interfaceSerializer<dev.langchain4j.data.message.AiMessage>- Parameters:
in- the input stream to read the serialized object from- Returns:
- the deserialized AiMessage object
- Throws:
IOException- if an I/O error occurs during deserializationClassNotFoundException- if the class of a serialized object cannot be found
-