在正文 main 中注册后执行:
for sku,expected in [('A',3),('B',0),('X',-1)]:
result=await kernel.invoke(plugin['lookup'],arguments=KernelArguments(sku=sku))
assert result.value==expected
print('native functions passed')Kernel 可以直接调用原生函数,模型服务只在 prompt/function choice 等需要推理时使用。