adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
36 lines (35 loc) • 971 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SequentialAgent = void 0;
const BaseAgent_1 = require("./BaseAgent");
/**
* A shell agent that runs its sub-agents in sequence.
*/
class SequentialAgent extends BaseAgent_1.BaseAgent {
/**
* Implement the required setUserContent method
*
* @param content The user content
* @param invocationContext The invocation context
*/
setUserContent(content, invocationContext) {
// Simply pass through to sub-agents - they'll handle the content when invoked
}
/**
* @inheritdoc
*/
async *runAsyncImpl(ctx) {
for (const subAgent of this.subAgents) {
yield* subAgent.invoke(ctx);
}
}
/**
* @inheritdoc
*/
async *runLiveImpl(ctx) {
for (const subAgent of this.subAgents) {
yield* subAgent.invoke(ctx);
}
}
}
exports.SequentialAgent = SequentialAgent;