MapReduceOptions
Interface: MapReduceOptions
Defined in: src/patterns/MapReduce.ts:32
Properties
id?
readonlyoptionalid?:string
Defined in: src/patterns/MapReduce.ts:58
mapPrompt
readonlymapPrompt:string
Defined in: src/patterns/MapReduce.ts:36
System prompt applied to every shard's LLMCall.
maxTokens?
readonlyoptionalmaxTokens?:number
Defined in: src/patterns/MapReduce.ts:56
model
readonlymodel:string
Defined in: src/patterns/MapReduce.ts:34
name?
readonlyoptionalname?:string
Defined in: src/patterns/MapReduce.ts:57
provider
readonlyprovider:LLMProvider
Defined in: src/patterns/MapReduce.ts:33
reduce
readonlyreduce: {fn:MergeFn;kind:"fn"; } | {kind:"llm";opts:MergeWithLLMOptions; }
Defined in: src/patterns/MapReduce.ts:52
Reducer — either a pure fn combining the N shard outputs, OR an LLM synthesizer.
shardCount
readonlyshardCount:number
Defined in: src/patterns/MapReduce.ts:41
Number of shards to fan out. Must be >= 2 (for one-shard, use
LLMCall directly). Fixed at build time.
split
readonlysplit: (input,shardCount) => readonlystring[]
Defined in: src/patterns/MapReduce.ts:47
Splitter invoked at run time with (input, shardCount). MUST return
exactly shardCount strings. If it returns fewer, remaining shards
receive empty strings; more are truncated.
Parameters
input
string
shardCount
number
Returns
readonly string[]
temperature?
readonlyoptionaltemperature?:number
Defined in: src/patterns/MapReduce.ts:55
