feat: add fanout mixture metadata
This commit is contained in:
parent
8dd7e961a3
commit
237e8d2367
|
|
@ -47,6 +47,7 @@ describe("DynamicWorkflows fan-out routing", () => {
|
||||||
expect(result.routeContexts[1]?.flow).toBe("planning");
|
expect(result.routeContexts[1]?.flow).toBe("planning");
|
||||||
expect(result.routeContexts[2]?.flow).toBe("review");
|
expect(result.routeContexts[2]?.flow).toBe("review");
|
||||||
expect(result.iterations).toHaveLength(3);
|
expect(result.iterations).toHaveLength(3);
|
||||||
|
expect(result.mixtureOfAgents).toEqual({ provider: "fable-fan-out", workers: 3, synthesizer: "caller-provided", maxConcurrency: 3 });
|
||||||
expect(result.synthesisVerdict).toBeDefined();
|
expect(result.synthesisVerdict).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,19 @@ export interface WorkflowDefinition {
|
||||||
maxConcurrency?: number;
|
maxConcurrency?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MixtureOfAgentsMetadata {
|
||||||
|
provider: "fable-fan-out";
|
||||||
|
workers: number;
|
||||||
|
synthesizer: "caller-provided";
|
||||||
|
maxConcurrency: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface FanOutResult {
|
export interface FanOutResult {
|
||||||
iterations: LoopIteration[];
|
iterations: LoopIteration[];
|
||||||
routeContexts: FanOutSubtaskRouteContext[];
|
routeContexts: FanOutSubtaskRouteContext[];
|
||||||
synthesized: LoopIteration;
|
synthesized: LoopIteration;
|
||||||
synthesisVerdict: VerificationResult;
|
synthesisVerdict: VerificationResult;
|
||||||
|
mixtureOfAgents: MixtureOfAgentsMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdversarialResult {
|
export interface AdversarialResult {
|
||||||
|
|
@ -136,7 +144,18 @@ export class DynamicWorkflows {
|
||||||
// Phase 3: Verify the synthesis
|
// Phase 3: Verify the synthesis
|
||||||
const synthesisVerdict = this.verifier.verify(synthesized, task);
|
const synthesisVerdict = this.verifier.verify(synthesized, task);
|
||||||
|
|
||||||
return { iterations, routeContexts, synthesized, synthesisVerdict };
|
return {
|
||||||
|
iterations,
|
||||||
|
routeContexts,
|
||||||
|
synthesized,
|
||||||
|
synthesisVerdict,
|
||||||
|
mixtureOfAgents: {
|
||||||
|
provider: "fable-fan-out",
|
||||||
|
workers: subTasks.length,
|
||||||
|
synthesizer: "caller-provided",
|
||||||
|
maxConcurrency,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue