Consensus Builder
class ConsensusBuilder<RESULT : Any>(resultClass: Class<RESULT>, maxConcurrency: Int = DEFAULT_MAX_CONCURRENCY)
Builder for creating a consensus workflow that generates results from multiple generators Generators and consensus function are typically used in multi-model scenarios, but need not use an LLM at all.
Types
Link copied to clipboard
Link copied to clipboard
inner class ConsensusSpec(generators: List<Function<out SupplierActionContext<RESULT>, RESULT>>, consensusFunction: (TransformationActionContext<ResultList<RESULT>, RESULT>) -> RESULT) : WorkflowBuilder<RESULT>
Link copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
fun withSources(generators: List<Function<out SupplierActionContext<RESULT>, RESULT>>): ConsensusBuilder.Generators<RESULT>