construct_from_dict()
This operation constructs a Function
object from a dictionary representation.
Request Syntax
construct_from_dict(
raw: dict
)
PARAMETERS:
raw
(dict)A dictionary containing the raw data to construct the collection schema.
RETURN TYPE:
Function
RETURNS:
A Function
object.
EXCEPTIONS:
MilvusException
This exception will be raised when any error occurs during this operation.
Examples
from pymilvus import Function
function_dict = {
"name": "bm25",
"type": "BM25",
"input_field_names": ["text"],
"output_field_names": ["score"],
"description": "BM25 text search function",
"params": {
"bm25_k1": 1.2,
"bm25_b": 0.75
}
}
function = Function.construct_from_dict(function_dict)
print(function)