class VectorSimilarityFunction extends Scalar<Float, float[]> {

    public static void register(Functions.Builder module) {
        module.add(
            Signature.scalar(
                "vector_similarity",
                FloatVectorType.INSTANCE_ONE.getTypeSignature(),
                FloatVectorType.INSTANCE_ONE.getTypeSignature(),
                DataTypes.FLOAT.getTypeSignature()
            ).withFeature(Scalar.Feature.NULLABLE),
            VectorSimilarityFunction::new
        );
    }

    private VectorSimilarityFunction(Signature signature, BoundSignature boundSignature) {
        super(signature, boundSignature);
    }

    @Override
    public Float evaluate(TransactionContext txnCtx, NodeContext nodeContext, Input<float[]>... args) {<FILL_FUNCTION_BODY>}
}

        assert args.length == 2 : "Invalid number of arguments";

        var v1 = args[0].value();
        var v2 = args[1].value();

        if (v1 == null || v2 == null) {
            return null;
        }

        if (v1.length != v2.length) {
            throw new IllegalArgumentException("Vectors must have same length");
        }

        return FloatVectorType.SIMILARITY_FUNC.compare(v1, v2);
    
<methods>public BoundSignature boundSignature() ,public Scalar<java.lang.Float,float[]> compile(List<io.crate.expression.symbol.Symbol>, java.lang.String, io.crate.role.Roles) ,public transient abstract java.lang.Float evaluate(io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext, Input<float[]>[]) ,public io.crate.expression.symbol.Symbol normalizeSymbol(io.crate.expression.symbol.Function, io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext) ,public io.crate.metadata.functions.Signature signature() <variables>public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_AND_COMPARISON_REPLACEMENT,public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_ONLY,public static final Set<io.crate.metadata.Scalar.Feature> NO_FEATURES,protected final non-sealed BoundSignature boundSignature,protected final non-sealed io.crate.metadata.functions.Signature signature