to_dict()
This operation returns a dictionary representation of the Function
object.
Request Syntax
to_dict()
PARAMETERS:
None
RETURN TYPE:
dict
RETURNS:
The dictionary representation of the Function
object.
EXCEPTIONS:
MilvusException
This exception will be raised when any error occurs during this operation.
Examples
from pymilvus import Function, FunctionType
bm25_function = Function(
name="bm25_fn",
input_field_names=["document_content"],
output_field_names="sparse_vector",
function_type=FunctionType.BM25,
)
bm25_func_dict = bm25_function.to_dict()
print(bm25_func_dict)