langchain_community.chains.ernie_functions.base.convert_to_ernie_function

langchain_community.chains.ernie_functions.base.convert_to_ernie_function(function: Union[Dict[str, Any], Type[BaseModel], Callable]) Dict[str, Any][source]

将原始函数/类转换为 Ernie 函数。

参数:
function:可以是字典、pydantic.BaseModel 类,或 Python 函数。

如果传入的是字典,则假定它已经是有效的 Ernie 函数。

返回:

传入函数的字典版本,与 Ernie 函数调用 API 兼容。

Parameters

function (Union[Dict[str, Any], Type[BaseModel], Callable]) –

Return type

Dict[str, Any]