For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/genui/a2ui/functions/defineFunction.md.
Lynx
  • 简体中文
  • 函数: defineFunction()

    defineFunction(impl: FunctionImpl, manifest?: FunctionManifest): CatalogFunctionEntry

    为 defineCatalog 构建函数条目。可以把实现与提取出的 manifest 配对,也可以只传实现(注册表仍会路由调用,只是 agent 看不到参数 schema)。

    参数

    参数类型
    implFunctionImpl
    manifest?FunctionManifest

    返回

    CatalogFunctionEntry

    示例

    const requiredEntry = defineFunction(required, requiredManifest);
    const catalog = defineCatalog([Text, Button, requiredEntry]);
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。