Commit Graph
5139 Commits
Author SHA1 Message Date
Sydney Runkle c712e09fbc conditional for config 2025-04-29 18:17:33 -04:00
Sydney Runkle 80dca9b9a5 removing remaining v1 logic 2025-04-29 15:11:37 -04:00
Sydney Runkle da0994b741 removing langchain-core pydantic utilities 2025-04-29 14:31:28 -04:00
Sydney Runkle 64cfbb0d02 remove v1 test 2025-04-29 13:51:45 -04:00
Sydney Runkle e99028cfc6 what would it look like to remove pydantic v1 support? 2025-04-28 21:44:17 -04:00
William FHandGitHub 062253fe48 Add examples of configurable headers (#4445) 2025-04-28 12:52:06 -07:00
Sydney RunkleandGitHub fc0d08328d langgraph: fix bug + add test for multi resume (#4444)
Fine if command is "empty" as we don't add writes for mapped resumes.
2025-04-28 15:48:33 -04:00
Sydney Runkle 2bf8e690b0 test + bug fix 2025-04-28 15:41:37 -04:00
Vadym BardaandGitHub 11c6a54de9 docs: small update in the manage message history how to (#4442) 2025-04-28 13:22:52 -04:00
Nuno CamposandGitHub 78581b80c2 Support multiple resume values with Command.resume (#4406)
* Adding support for mapping interrupt ids -> resume values with the
`Command.resume_map` argument, like:

```py
resume_map = {
    i.interrupt_id: f"human input for prompt {i.value}" 
    for i in parent_graph.get_state(thread_config).interrupts 
}

parent_graph.invoke(Command(resume=resume_map), config=thread_config)
```

* Adds an `interrupts` attribute on `StateSnapshot` so that we can
access that directly rather than having to do
`get_state(thread_config).tasks` and then iterate over tasks to find
interrupts

* Deprecates undocumented feature where (if interrupting a graph from
the level of an interrupt), you could pass a dict mapping task ids ->
resume values. Now we recommend and endorse the `interrupt_id` approach
above.

I'll note, from an internal perspective, I would love if we didn't have
to pass around this map, but it seems like the best way right now to
make the necessary resume information necessary at different levels in a
graph with subgraphs.

Fix https://github.com/langchain-ai/langgraph/issues/4028

Slotted to be included in our v0.4.0 release early next week!
2025-04-28 09:06:58 -07:00
Sydney Runkle 5fee0d9d66 skip yielding interrupt if input was a map 2025-04-28 11:47:51 -04:00
William FHandGitHub 68e3d70967 Add section in how-to on exclusions (#4441) 2025-04-28 08:42:32 -07:00
William FHandGitHub dc9f2b1109 Add how-to on headers (#4440)
and their configurability for configurability
2025-04-28 15:31:48 +00:00
William FHandGitHub 67aeba6210 Add schema updates for the configurable headers (#4437) 2025-04-28 15:10:07 +00:00
Sydney Runkle dbf1c28ccd lint 2025-04-28 10:22:30 -04:00
Sydney Runkle cb25ef985d update loop to append mapped tasks to task specific values 2025-04-28 10:18:39 -04:00
Sydney RunkleandGitHub 2f49ebfd53 packaging: Remove Python Upper Bounds (#4416)
A few notes:
* We shouldn't be using `tool.poetry.dependencies`, that's deprecated -
waiting for a future PR to address this big change though.
* We should remove upper bounds for all deps unless strictly necessary.
2025-04-28 10:03:43 -04:00
David DuongandGitHub d9c781cc7d feat(js): add message-specific fallback UI components (#4430) 2025-04-28 12:17:07 +02:00
David DuongandGitHub 66af72acb3 fix(sdk-js): remove client-only bootstrapping warning (#4428) 2025-04-28 12:05:43 +02:00
Tat Dat Duong a44d822cd3 feat(js): add message-specific fallback UI components 2025-04-28 12:03:58 +02:00
Tat Dat Duong 28d884b37a fix(sdk-js): remove client-only bootstrapping warning 2025-04-28 11:52:26 +02:00
William FHandGitHub d7a0da8f06 checkpointer: Enter stack for blobs dict in InMemorySaver (#4419) checkpoint==2.0.25 2025-04-26 13:57:36 -07:00
Vadym BardaandGitHub 2d9347ec33 docs(cloud): update human-in-the-loop guides to use interrupt() (#4418) 2025-04-26 13:37:06 -04:00
Sydney Runkle 5e9bea5134 no upper bounds for python 2025-04-25 17:45:54 -07:00
Sydney RunkleandGitHub 5ddc24ba85 Merge branch 'main' into multi-resumes 2025-04-25 17:05:35 -07:00
Sydney Runkle 0362840d0b revert debugging note"
"
2025-04-25 17:00:26 -07:00
Sydney Runkle 44099d27c8 fixing tests 2025-04-25 16:53:37 -07:00
Nuno CamposandGitHub 8951d162f0 Improve logic for drawing virtual end node (#4409)
- Don't draw unexpected edges to END node
- If a conditional edge has a custom label for END node then draw it
2025-04-25 15:45:12 -07:00
Nuno Campos d90126b34e Fix 2025-04-25 15:38:41 -07:00
Nuno CamposandGitHub adc4569daf build(deps): bump h11 from 0.14.0 to 0.16.0 in /libs/checkpoint-sqlite (#4403)
Bumps [h11](https://github.com/python-hyper/h11) from 0.14.0 to 0.16.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/python-hyper/h11/commit/1c5b07581f058886c8bdd87adababd7d959dc7ca"><code>1c5b075</code></a>
this time for surer</li>
<li><a
href="https://github.com/python-hyper/h11/commit/d9c369935e853a7ee1aeb7e481f6dddf9b9c9b8a"><code>d9c3699</code></a>
this time for sure...</li>
<li><a
href="https://github.com/python-hyper/h11/commit/d91b9dd2290a25c8c3f5ec15feb57de5873e6e39"><code>d91b9dd</code></a>
blacken</li>
<li><a
href="https://github.com/python-hyper/h11/commit/5a4683ca466b59bbab9b19cfea20ee157b31cee0"><code>5a4683c</code></a>
Soothe mypy</li>
<li><a
href="https://github.com/python-hyper/h11/commit/9c9567f0a92d13a83a8d8ebdbc757c8c2d384536"><code>9c9567f</code></a>
Bump version to 0.16.0</li>
<li><a
href="https://github.com/python-hyper/h11/commit/114803a29ce50116dc47951c690ad4892b1a36ed"><code>114803a</code></a>
Merge commit from fork</li>
<li><a
href="https://github.com/python-hyper/h11/commit/9462006f6ce4941661888228cbd4ac1ea80689b0"><code>9462006</code></a>
Bump version to 0.15.0</li>
<li><a
href="https://github.com/python-hyper/h11/commit/70a96bea8e55403e5d92db14c111432c6d7a8685"><code>70a96be</code></a>
Merge pull request <a
href="https://redirect.github.com/python-hyper/h11/issues/181">#181</a>
from Julien00859/Julien00859/get_int_max_str_digits</li>
<li><a
href="https://github.com/python-hyper/h11/commit/60782ad107e538b9312aac7e1c119c8358bf797c"><code>60782ad</code></a>
Reject Content-Length longer 1 billion TB</li>
<li><a
href="https://github.com/python-hyper/h11/commit/dff7cc397a26ed4acdedd92d1bda6c8f18a6ed9f"><code>dff7cc3</code></a>
Validate Chunked-Encoding chunk footer</li>
<li>Additional commits viewable in <a
href="https://github.com/python-hyper/h11/compare/v0.14.0...v0.16.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=h11&package-manager=pip&previous-version=0.14.0&new-version=0.16.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/langchain-ai/langgraph/network/alerts).

</details>
2025-04-25 15:23:46 -07:00
Nuno Campos 6d70559618 Upgrade 2025-04-25 15:17:06 -07:00
Nuno Campos 70afd2dc2c Update all 2025-04-25 15:11:32 -07:00
ccurmeandGitHub 14e7215090 docs: use langchain-tavily in quickstart (#4412)
We want to deprecate `TavilySearchResults` in langchain-community in
favor of `TavilySearch` in langchain-tavily.

Also update quickstart to use `init_chat_model`.
2025-04-25 17:54:37 -04:00
Nuno Campos 460edde3a7 Lint 2025-04-25 14:37:53 -07:00
Nuno Campos 34d591dedf Improve logic for drawing virtual end node
- Don't draw unexpected edges to END node
- If a conditional edge has a custom label for END node then draw it
2025-04-25 14:37:53 -07:00
Daehwi KimandGitHub 746b5f0730 fix(docs): fix typo (#4411) 2025-04-25 17:10:47 -04:00
Vadym BardaandGitHub 64448404de ci: don't try to render mermaid images when testing notebooks (#4414) 2025-04-25 17:09:18 -04:00
Andrew NguonlyandGitHub 9637f3b1be docs: Document API endpoint for creating new project (#4413) 2025-04-25 10:42:20 -07:00
Sydney Runkle 50449af1a9 add convenient interrupt access to StateSnapshot 2025-04-24 14:52:54 -07:00
Sydney Runkle c2fa33e055 linting etc 2025-04-24 13:28:29 -07:00
Sydney Runkle 644a6c3b63 use resume instead of resume_map and deprecate old mapping task_id -> resume logic 2025-04-24 13:26:01 -07:00
Jacob LeeandGitHub c7fe85585b docs: Adds additional Google Analytics tag to docs (#4402)
CC @danielrlambert3
2025-04-24 13:17:52 -07:00
Sydney Runkle 847b9c13ac adding docs example 2025-04-24 12:36:35 -07:00
Sydney Runkle b6963d35aa multi hitl with new hash pattern 2025-04-24 11:21:25 -07:00
dependabot[bot]andGitHub c6971c6a58 build(deps): bump h11 from 0.14.0 to 0.16.0 in /libs/checkpoint-sqlite
Bumps [h11](https://github.com/python-hyper/h11) from 0.14.0 to 0.16.0.
- [Commits](https://github.com/python-hyper/h11/compare/v0.14.0...v0.16.0)

---
updated-dependencies:
- dependency-name: h11
  dependency-version: 0.16.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-24 17:46:01 +00:00
Sydney RunkleandGitHub 2327f8619f docs: fix xlinks (api and general) (#4391)
Mostly focusing on the API docs xrefs now working, for example:

<img width="728" alt="Screenshot 2025-04-23 at 6 43 40 PM"
src="https://github.com/user-attachments/assets/e0939edb-2088-4b4e-92b0-8009aac6a86e"
/>

--> 

<img width="737" alt="Screenshot 2025-04-23 at 7 57 28 PM"
src="https://github.com/user-attachments/assets/d05e28b5-cf4f-41e0-96f8-9910d19f4657"
/>

Also fixed some other broken links / references.

There are lots of broken links related to langgraph plans / deployment
options, I think our new docs writer was going to work on those.
2025-04-24 08:47:08 -07:00
Sydney RunkleandGitHub 4eb124e83d [breaking]: Improve interrupt behavior when stream_mode='values' (#4374)
This PR does a few things:
1. Surfaces interrupts when `stream_mode='values'` (particularly
relevant for `invoke`, where this is the default behavior)
2. Adds an `interrupt_id` property to the `Interrupt` dataclass so that
interrupts can effectively be mapped to resumes
3. Minor docs updates to reflect the new pattern (no need for a special
section on interrupts with `invoke` and `ainvoke`)

* In a different PR (the one with the multiple resume values), as it's
more relevant there: add an `interrupts` property to `StateSnapshot` so
that `interrupts` can easily be iterated over if users are attempting to
map interrupts to resumes.

I **don't** recommend we release this until we have multi-resumes
working.

## Example

We have the following setup where we're sending multiple prompts to the
child graph, which uses `interrupt`:

```py
def child_graph(state):
    human_input = interrupt(state["prompt"])

    return {
        "human_inputs": [human_input],
    }
```

<img width="142" alt="Screenshot 2025-04-23 at 10 01 12 AM"
src="https://github.com/user-attachments/assets/c6238bf1-54ad-4e48-ab0b-60a0bfc18485"
/>

Old behavior:

```py
initial_input = {"prompts": ["a", "b"]}

print(parent_graph.invoke(input=initial_input,config=thread_config,stream_mode="values"))
#> {'prompts': ['a', 'b'], 'human_inputs': []}

print(parent_graph.invoke(Command(resume="hello 1"),config=thread_config,stream_mode="values"))
#> {'prompts': ['a', 'b'], 'human_inputs': ['hello 1']}

print(parent_graph.invoke(Command(resume="hello 2"),config=thread_config,stream_mode="values"))
#> {'prompts': ['a', 'b'], 'human_inputs': ['hello 1', 'hello 2']}
```

New behavior:

```py
initial_input = {"prompts": ["a", "b"]}

print(parent_graph.invoke(input=initial_input,config=thread_config,stream_mode="values"))
"""
{
  "prompts": ["a", "b"],
  "human_inputs": [],
  "__interrupt__": [
    Interrupt(
      value="a",
      resumable=True,
      ns=["child_graph:38d43a18-a5e7-8ab2-ca83-9d80f6e9ca83"]
    ),
    Interrupt(
      value="b",
      resumable=True,
      ns=["child_graph:dad810e8-738e-9f90-41cd-30c0091eb79b"]
    )
  ]
}
"""

print(parent_graph.invoke(Command(resume="hello 1"),config=thread_config,stream_mode="values"))
"""
{
  "prompts": ["a", "b"],
  "human_inputs": ["hello 1"],
  "__interrupt__": [
    Interrupt(
      value="b",
      resumable=True,
      ns=["child_graph:dad810e8-738e-9f90-41cd-30c0091eb79b"]
    )
  ]
}
"""

print(parent_graph.invoke(Command(resume="hello 2"),config=thread_config,stream_mode="values"))
#> {'prompts': ['a', 'b'], 'human_inputs': ['hello 1', 'hello 2']}
```
2025-04-24 08:21:28 -07:00
Sydney Runkle 84e9ebda91 add back auto gen content 2025-04-24 08:16:03 -07:00
Sydney Runkle 48e8576fcf remove auto gen file 2025-04-24 08:15:06 -07:00
William FHandGitHub 6263c2f710 Copy with cached property (#4399) 0.3.34 2025-04-24 07:16:37 -07:00