to_dict()
此操作返回 Function 对象的字典表示。
请求语法
python
to_dict()
返回类型:
dict
返回值:
Function 对象的字典表示。
异常:
-
MilvusException
此操作期间发生任何错误时,都会引发此异常。此操作期间发生任何错误时,都会引发此异常。
示例
python
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)