跳至主要内容

子代理(@call)

通过 @call: 实现模块间调用。

语法

@call:ui-spec-generator($ARGUMENTS)

context 配置

module.yaml 中:

context: fork   # fork | main

运行方式

子代理编排通过 编程 API 使用:

import { runWithSubagents, getProvider } from 'cognitive-modules-cli';

const provider = getProvider('openai', 'gpt-4o');
const result = await runWithSubagents('product-analyzer', provider, {
args: 'health product website'
});

CLI run 不会自动解析 @call

限制

限制
最大深度5
循环调用自动阻止
子模块校验跳过输入校验,保留输出校验