Commit Graph
6621 Commits
Author SHA1 Message Date
Quanzheng Long 90865e2af9 simplify 2026-03-17 18:24:37 -07:00
Quanzheng Long e13004da77 stream-draft 2026-03-17 16:12:16 -07:00
Quanzheng Long 5a9264d124 v2 2026-03-16 16:53:09 -07:00
Quanzheng Long efa86a6b14 fix 2026-03-16 16:52:05 -07:00
Quanzheng Long f9866186d9 makefile 2026-03-16 16:46:33 -07:00
Quanzheng Long bfdd7deb60 makefile 2026-03-16 16:41:14 -07:00
Quanzheng Long 09c8bb7c1c revert 2026-03-16 16:34:17 -07:00
Quanzheng Long 84d59adcd8 publish 2026-03-16 16:31:02 -07:00
Quanzheng Long 841ebf0c77 publish 2026-03-16 16:18:25 -07:00
Quanzheng Long 4f5b775819 no-finish-node 2026-03-16 15:55:35 -07:00
Quanzheng Long 76bee17ec4 fix 2026-03-14 17:58:28 -07:00
Quanzheng Long d4335683e6 rewrite-state-graph 2026-03-14 17:56:30 -07:00
Quanzheng Long b43107ec99 rewrite-state-graph 2026-03-14 17:50:55 -07:00
Quanzheng Long 3987f9cd63 rewrite-state-graph 2026-03-14 17:47:33 -07:00
Quanzheng Long 2bbc3bb1da more 2026-03-14 11:30:25 -07:00
Quanzheng Long b3474d2db1 more 2026-03-14 10:29:42 -07:00
Quanzheng Long 56e9fe1b10 more 2026-03-13 23:31:52 -07:00
Quanzheng Long 1b3d075dbb tokio-rewrite 2026-03-13 23:16:40 -07:00
Quanzheng Long c2a9661d2a more 2026-03-13 21:54:02 -07:00
Quanzheng Long 9e723642c0 more 2026-03-13 15:46:07 -07:00
Quanzheng Long 7c0a9275f9 more 2026-03-13 15:44:41 -07:00
Quanzheng Long 783b3d3435 more 2026-03-13 15:40:49 -07:00
Quanzheng Long 597b3402e6 optimizeUpdateState 2026-03-13 15:07:41 -07:00
Quanzheng Long 54b723775c more 2026-03-13 14:23:54 -07:00
Quanzheng Long 93c4a0a2d5 more 2026-03-13 14:14:58 -07:00
Quanzheng Long a5b90fbb95 more 2026-03-13 13:52:28 -07:00
Quanzheng Long 85272db354 more 2026-03-13 13:50:52 -07:00
Quanzheng Long d7614999b0 more 2026-03-13 13:44:44 -07:00
Quanzheng Long af5f74f2ad more 2026-03-13 13:27:32 -07:00
Quanzheng Long 708c0dff7f more 2026-03-13 13:21:11 -07:00
Quanzheng Long d50801d871 more 2026-03-13 13:16:11 -07:00
Quanzheng Long 0327a86b80 rename 2026-03-12 22:42:47 -07:00
Quanzheng Long 13847a32c0 refactor-go 2026-03-12 22:41:32 -07:00
Quanzheng Long 03ad7a011c imp 2026-03-12 21:48:32 -07:00
Quanzheng Long 896c1a8054 draft 2026-03-12 18:44:18 -07:00
Quanzheng Long 388d6b3593 done 2026-03-12 16:05:12 -07:00
Quanzheng Long 667b679694 more 2026-03-12 15:58:42 -07:00
Quanzheng Long ccb9f4c41a more 2026-03-12 15:58:21 -07:00
Quanzheng Long 789be99634 ref 2026-03-12 15:44:35 -07:00
Quanzheng Long e33842ff54 mre 2026-03-12 15:39:46 -07:00
Quanzheng Long 89d37a0f9b more 2026-03-12 15:38:22 -07:00
Quanzheng Long 8f717d3874 more 2026-03-12 15:27:25 -07:00
Quanzheng Long 508193272a anyof 2026-03-12 15:15:49 -07:00
Quanzheng Long 788ae6cb72 rm 2026-03-12 15:03:58 -07:00
Quanzheng Long b2dca399e8 1 2026-03-12 13:31:54 -07:00
Quanzheng Long 4b2167dd25 1stpass 2026-03-12 13:13:08 -07:00
Quanzheng Long be46e91180 doc 2026-03-12 12:37:34 -07:00
Quanzheng Long bbb308259b poc 2026-03-12 12:31:46 -07:00
Sydney RunkleandGitHub 14ce607111 chore: remove md notes (#7103) 2026-03-10 08:44:55 -04:00
Sydney RunkleandGitHub 3330ccdea4 release(langgraph): 1.1 (#7102)
exciting!

relnotes preview:

# LangGraph 1.1.0 Release Notes

## Type-Safe Streaming & Invoke

LangGraph 1.1 introduces `version="v2"` — a new opt-in streaming format
that brings full type safety to `stream()`, `astream()`, `invoke()`, and
`ainvoke()`.

### What's changing

**v1 (default, unchanged):** `stream()` yields bare tuples like
`(stream_mode, data)` or just `data`. `invoke()` returns a plain `dict`.
Interrupts are mixed into the output dict under `"__interrupt__"`.

**v2 (opt-in):** `stream()` yields strongly-typed `StreamPart` dicts
with `type`, `ns`, `data`, and (for values) `interrupts` fields.
`invoke()` returns a `GraphOutput` object with `.value` and
`.interrupts` attributes. When your state schema is a Pydantic model or
dataclass, outputs are automatically coerced to the correct type.

### `invoke()` / `ainvoke()` with `version="v2"`

```python
from langgraph.types import GraphOutput

result = graph.invoke({"input": "hello"}, version="v2")

# result is a GraphOutput, not a dict
assert isinstance(result, GraphOutput)
result.value       # your output — dict, Pydantic model, or dataclass
result.interrupts  # tuple[Interrupt, ...], empty if none occurred
```

With a non-`"values"` stream mode, `invoke(..., stream_mode="updates",
version="v2")` returns `list[StreamPart]` instead of `list[tuple]`.

### `stream()` / `astream()` with `version="v2"`

```python
for part in graph.stream({"input": "hello"}, version="v2"):
    if part["type"] == "values":
        part["data"]        # OutputT — full state
        part["interrupts"]  # tuple[Interrupt, ...]
    elif part["type"] == "updates":
        part["data"]        # dict[str, Any]
    elif part["type"] == "messages":
        part["data"]        # tuple[BaseMessage, dict]
    elif part["type"] == "custom":
        part["data"]        # Any
    elif part["type"] == "tasks":
        part["data"]        # TaskPayload | TaskResultPayload
    elif part["type"] == "debug":
        part["data"]        # DebugPayload
```

Each stream mode has its own `TypedDict` — `ValuesStreamPart`,
`UpdatesStreamPart`, `MessagesStreamPart`, `CustomStreamPart`,
`CheckpointStreamPart`, `TasksStreamPart`, `DebugStreamPart` — all
importable from `langgraph.types`. The union type `StreamPart` is a
discriminated union on `part["type"]`, enabling full type narrowing in
editors and type checkers.

### Pydantic & dataclass output coercion

When your graph's state schema is a Pydantic model or dataclass,
`version="v2"` automatically coerces outputs to the declared type:

```python
from pydantic import BaseModel

class MyState(BaseModel):
    answer: str
    count: int

graph = StateGraph(MyState)
# ... build graph ...
compiled = graph.compile()

result = compiled.invoke({"answer": "", "count": 0}, version="v2")
assert isinstance(result.value, MyState)  # not a dict!
```

### Backward compatibility

- **Default is still `version="v1"`** — existing code works without
changes.
- To make migration easier, `GraphOutput` supports old-style best-effort
access to graph values and interrupts. Dict-style access
(`result["key"]`, `"key" in result`, `result["__interrupt__"]`) still
works and delegates to `result.value` / `result.interrupts` under the
hood. However, this is **deprecated** and emits a
`LangGraphDeprecatedSinceV11` warning. It will be removed in v3.0 —
migrate to `result.value` and `result.interrupts` at your convenience.

```python
result = graph.invoke({"input": "hello"}, version="v2")

# Old style — still works, but deprecated
result["input"]          # delegates to result.value["input"]
result["__interrupt__"]  # delegates to result.interrupts
"input" in result        # delegates to "input" in result.value

# New style — preferred
result.value["input"]
result.interrupts
```

## Migration Guide

1. **No action required** — `version="v1"` remains the default. All
existing code continues to work.
2. **Adopt v2 incrementally** — Add `version="v2"` to individual
`invoke()`/`stream()` calls to get typed outputs.
3. **Use typed imports** — Import `GraphOutput`, `StreamPart`, and
individual part types from `langgraph.types` for type-safe code.
1.1.0
2026-03-10 12:41:30 +00:00