agentskit.js

createEnsembleAdapter

Auto-generated API reference for createEnsembleAdapter.

Function: createEnsembleAdapter()

createEnsembleAdapter(options): AdapterFactory

Defined in: adapters/src/ensemble.ts:88

Build an AdapterFactory that runs the same request against N candidates in parallel, then aggregates the results into a single text output. Unlike speculate (which picks a winner), ensemble combines β€” majority vote, concatenation, longest, or a custom fn.

The returned source emits a single \{ type: 'text' \} chunk with the aggregated output followed by \{ type: 'done' \}, so it plugs into any runtime that expects a regular streaming adapter.

#Parameters

#options

EnsembleOptions

#Returns

AdapterFactory

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page