mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-06 17:57:49 +02:00
[docs]: add subgraph streaming how-to (and some small cleanups) (#1606)
* wip * spelling * edit format_namespace
This commit is contained in:
@@ -54,7 +54,7 @@ The first way to solve this is to add path maps to your conditional edges. A pat
|
||||
=== "Javascript"
|
||||
|
||||
```ts
|
||||
graph.addConditionalEdges("node_a", routingFunction, ["node_b", "node_c"]);
|
||||
graph.addConditionalEdges("node_a", routingFunction, { true: "node_b", false: "node_c" });
|
||||
```
|
||||
|
||||
In this case, the routing function returns either True or False, which map to `node_b` and `node_c` respectively.
|
||||
@@ -66,8 +66,8 @@ Instead of passing a path map, you can also be explicit about the typing of your
|
||||
```python
|
||||
def routing_function(state: GraphState) -> Literal["node_b","node_c"]:
|
||||
if state['some_condition'] == True:
|
||||
return "node_a"
|
||||
else:
|
||||
return "node_b"
|
||||
else:
|
||||
return "node_c"
|
||||
```
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ These guides show how to use different streaming modes.
|
||||
- [How to stream events from within a tool](streaming-events-from-within-tools.ipynb)
|
||||
- [How to stream events from within a tool without LangChain models](streaming-events-from-within-tools-without-langchain.ipynb)
|
||||
- [How to stream events from the final node](streaming-from-final-node.ipynb)
|
||||
- [How to stream from subgraphs](streaming-subgraphs.ipynb)
|
||||
|
||||
## Tool calling
|
||||
|
||||
|
||||
Reference in New Issue
Block a user