[docs]: add subgraph streaming how-to (and some small cleanups) (#1606)

* wip

* spelling

* edit format_namespace
This commit is contained in:
Isaac Francisco
2024-09-05 20:37:47 -07:00
committed by GitHub
parent 6134b0e995
commit 8fc0eecac1
6 changed files with 376 additions and 5 deletions
+3 -3
View File
@@ -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"
```
+1
View File
@@ -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