MCPcopy Create free account
hub / github.com/bytedance/bolt / registerPythonFunction

Function registerPythonFunction

bolt/python/Function.cpp:90–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89namespace bolt::python {
90void registerPythonFunction(
91 pybind11::function callable,
92 const std::string& functionName,
93 const TypePtr& returnType,
94 const size_t nArgs,
95 std::vector<pybind11::object> defaultArgs,
96 bool mapBatch) {
97 const size_t nOptionalArgs = defaultArgs.size();
98 registerVectorFunction(
99 functionName,
100 mapBatch ? getSignatures(returnType)
101 : getSignatures(returnType, nArgs, nOptionalArgs),
102 std::make_unique<PythonFunction>(
103 std::move(callable), nArgs, std::move(defaultArgs), mapBatch));
104}
105} // namespace bolt::python

Callers

nothing calls this directly

Calls 3

getSignaturesFunction · 0.85
registerVectorFunctionFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected