FunctionParamValue

A typed value used for function-chain expression and operation parameters.

io.milvus.v2.service.vector.request.FunctionParamValue

Methods

  • static FunctionParamValue of(boolean value)

    Creates a boolean parameter value.

  • static FunctionParamValue of(long value)

    Creates an integer parameter value.

  • static FunctionParamValue of(double value)

    Creates a floating-point parameter value.

  • static FunctionParamValue of(String value)

    Creates a string parameter value.

  • static FunctionParamValue of(byte[] value)

    Creates a binary parameter value from a byte array.

  • static FunctionParamValue of(ByteString value)

    Creates a binary parameter value from a protobuf ByteString.

  • static FunctionParamValue ofArray(List<FunctionParamValue> values)

    Creates an array parameter value from a list of typed values.

  • static FunctionParamValue ofObject(Map<String, FunctionParamValue> fields)

    Creates an object parameter value from a map of field values.

  • static FunctionParamValue from(Object value)

    Creates a parameter value by inferring the type from a Java object.

Example

import io.milvus.v2.service.vector.request.FunctionChainArg;
import io.milvus.v2.service.vector.request.FunctionChainExpr;
import io.milvus.v2.service.vector.request.FunctionParamValue;
import java.util.Arrays;

// Build a FunctionChainExpr with literal parameter values
FunctionChainExpr expr = FunctionChainExpr.builder()
        .name("num_combine")
        .arg(FunctionChainArg.col("$score"))
        .param("weights", Arrays.asList(FunctionParamValue.of(0.7), FunctionParamValue.of(0.3)))
        .build();

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?