compact doc
This commit is contained in:
@@ -98,5 +98,4 @@ search - "decide" >> decide # Loop back
|
||||
|
||||
flow = Flow(start=decide)
|
||||
flow.run({"query": "Who won the Nobel Prize in Physics 2024?"})
|
||||
```
|
||||
|
||||
```
|
||||
@@ -14,7 +14,6 @@ MapReduce is a design pattern suitable when you have either:
|
||||
and there is a logical way to break the task into smaller, ideally independent parts.
|
||||
You first break down the task using [BatchNode](../core_abstraction/batch.md) in the map phase, followed by aggregation in the reduce phase.
|
||||
|
||||
|
||||
### Example: Document Summarization
|
||||
|
||||
```python
|
||||
@@ -36,4 +35,4 @@ map_node >> reduce_node
|
||||
# Create flow
|
||||
summarize_flow = Flow(start=map_node)
|
||||
summarize_flow.run(shared)
|
||||
```
|
||||
```
|
||||
@@ -122,4 +122,4 @@ reply - "continue" >> retrieve
|
||||
flow = Flow(start=retrieve)
|
||||
shared = {}
|
||||
flow.run(shared)
|
||||
```
|
||||
```
|
||||
@@ -70,7 +70,6 @@ Agent received: Network connectivity: stable | timestamp_2
|
||||
Agent received: Processing load: optimal | timestamp_3
|
||||
```
|
||||
|
||||
|
||||
### Interactive Multi-Agent Example: Taboo Game
|
||||
|
||||
Here's a more complex example where two agents play the word-guessing game Taboo.
|
||||
|
||||
@@ -9,7 +9,6 @@ nav_order: 2
|
||||
|
||||
Many real-world tasks are too complex for one LLM call. The solution is to decompose them into a [chain](../core_abstraction/flow.md) of multiple Nodes.
|
||||
|
||||
|
||||
> - You don't want to make each task **too coarse**, because it may be *too complex for one LLM call*.
|
||||
> - You don't want to make each task **too granular**, because then *the LLM call doesn't have enough context* and results are *not consistent across nodes*.
|
||||
>
|
||||
@@ -47,4 +46,4 @@ shared = {"topic": "AI Safety"}
|
||||
writing_flow.run(shared)
|
||||
```
|
||||
|
||||
For *dynamic cases*, consider using [Agents](./agent.md).
|
||||
For *dynamic cases*, consider using [Agents](./agent.md).
|
||||
Reference in New Issue
Block a user