Skip to content

Commit adaa340

Browse files
authored
fix(docs): jokes needs reducer in graph-api.md (langchain-ai#5489) (langchain-ai#5489)
1 parent 2c85cba commit adaa340

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/docs/how-tos/graph-api.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,12 +1152,13 @@ LangGraph supports map-reduce and other advanced branching patterns using the Se
11521152
```python
11531153
from langgraph.graph import StateGraph, START, END
11541154
from langgraph.types import Send
1155-
from typing_extensions import TypedDict
1155+
from typing_extensions import TypedDict, Annotated
1156+
import operator
11561157

11571158
class OverallState(TypedDict):
11581159
topic: str
11591160
subjects: list[str]
1160-
jokes: list[str]
1161+
jokes: Annotated[list[str], operator.add]
11611162
best_selected_joke: str
11621163

11631164
def generate_topics(state: OverallState):

0 commit comments

Comments
 (0)