class LangChainItemMarshaller implements MessageMarshaller<LangChainInfinispanItem> {

    private final String typeName;

    public LangChainItemMarshaller(String typeName) {
        this.typeName = typeName;
    }

    @Override
    public LangChainInfinispanItem readFrom(ProtoStreamReader reader) throws IOException {<FILL_FUNCTION_BODY>}

    @Override
    public void writeTo(ProtoStreamWriter writer, LangChainInfinispanItem item)
            throws IOException {
        writer.writeString("id", item.id());
        writer.writeFloats("embedding", item.embedding());
        writer.writeString("text", item.text());
        writer.writeCollection("metadata", item.metadata(), LangChainMetadata.class);
    }

    @Override
    public Class<? extends LangChainInfinispanItem> getJavaClass() {
        return LangChainInfinispanItem.class;
    }

    @Override
    public String getTypeName() {
        return typeName;
    }
}

        String id = reader.readString("id");
        float[] embedding = reader.readFloats("embedding");
        String text = reader.readString("text");
        Set<LangChainMetadata> metadata = reader.readCollection("metadata", new HashSet<>(), LangChainMetadata.class);
        return new LangChainInfinispanItem(id, embedding, text, metadata);
    
<no_super_class>