Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions pages/docs/concepts/chains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ assert_eq!(result, "16");

Execute multiple operations concurrently using the `parallel!` macro:

```rust filename="rig-core/src/pipeline/parallel.rs [196:208]"
]
values_and_positions: [
$($acc)*
$current ( $($underscores)* + )
]
munching: []
}
);

// Recursion step: map each value with its "position" (underscore count).
(
// Accumulate a token for each future that has been expanded: "_ _ _".
current_position: [
```rust filename="rig-core/src/pipeline/parallel.rs [369:379]"
let op2 = map(|x: i32| x * 2);


let pipeline = parallel!(
passthrough(),
op2,
map(|x: i32| format!("{x} is the number!")),
map(|x: i32| x == 1)
);


let result = pipeline.call(1).await;
assert_eq!(result, (1, 2, "1 is the number!".to_string(), true));
```

## AI-Specific Operations
Expand Down
Loading