Skip to content

Commit b1db280

Browse files
committed
feat: update CN version
1 parent ac76fe1 commit b1db280

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

content/en/docs/eino/core_modules/chain_and_graph_orchestration/orchestration_design_principles.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,18 @@ This principle also applies to Chunks in the StreamReader.
334334

335335
### **Fan-In and Merging**
336336

337-
**Fan-in**: Outputs from multiple predecessor nodes converge to a successor node and together serve as the input for the successor node. It is necessary to clearly define how the outputs of multiple predecessor nodes are **merged**. Eino's choice is as follows. First, it requires that the **actual types** of the outputs of multiple predecessor nodes must be the same Map type, and the keys among them must not be repeated. Second:
337+
**Fan-in**: Outputs from multiple predecessor nodes converge to a successor node and together serve as the input for the successor node. It is necessary to clearly define how the outputs of multiple predecessor nodes are **merged**. Eino's choice is as follows. First, it requires that the **actual types** of the outputs of multiple predecessor nodes must be the same and of a mergeable type.
338338

339-
- In non-streaming scenarios, after merging, it becomes a single map that contains all key-value pairs from all upstream sources.
339+
Mergeable types can be:
340+
341+
- Map type, and the keys are not repeated among each other.
342+
- Any type, and a merge function is registered through `compose.RegisterValuesMergeFunc`.
343+
344+
Second,
345+
346+
- In non-streaming scenarios,
347+
- if the input type has a registered merge function, it will be merged into a single value using the registered function.
348+
- if the input type is a Map, it will be merged into a single Map containing all key-value pairs from all upstream sources.
340349
- In streaming scenarios, multiple upstream StreamReaders of the same type are merged into one StreamReader. When actually receiving data from the merged StreamReader, the effect is to read fairly from multiple upstream StreamReaders.
341350

342351
When adding a node (AddNode), you can add the WithOutputKey option to convert the output of the node into a Map:

0 commit comments

Comments
 (0)