mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-19 22:25:44 +02:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e277a6bd9b | ||
|
|
16250fe038 | ||
|
|
216d1be0a5 | ||
|
|
0a4cd5fcaa | ||
|
|
f8503670af | ||
|
|
0f22841f78 |
@@ -4,11 +4,9 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v0
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- v0
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -84,9 +82,9 @@ jobs:
|
||||
run: make llms-text
|
||||
- name: Build site
|
||||
run: |
|
||||
# If this is v0 branch, then we want to download stats. we do this
|
||||
# If this is main branch, then we want to download stats. we do this
|
||||
# with the env variable DOWNLOAD_STATS=true
|
||||
if [ "${{ github.ref }}" == "refs/heads/v0" ]; then
|
||||
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||
DOWNLOAD_STATS=true make build-docs
|
||||
else
|
||||
make build-docs
|
||||
@@ -146,7 +144,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Configure GitHub Pages
|
||||
if: github.ref == 'refs/heads/v0'
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- name: Upload Pages Artifact
|
||||
@@ -156,6 +154,6 @@ jobs:
|
||||
path: ./docs/site/
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
if: github.ref == 'refs/heads/v0'
|
||||
if: github.ref == 'refs/heads/main'
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
@@ -2601,8 +2601,7 @@
|
||||
"description": "Configuration to use for the graph. Useful when graph is configurable and you want to update the assistant's configuration."
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"title": "Metadata",
|
||||
"type": "object", "title": "Metadata",
|
||||
"description": "Metadata to merge with existing assistant metadata."
|
||||
},
|
||||
"name": {
|
||||
@@ -2708,6 +2707,13 @@
|
||||
"title": "Schedule",
|
||||
"description": "The cron schedule to execute this job on."
|
||||
},
|
||||
"end_time": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"title": "End Time",
|
||||
"description": "The end date to stop running the cron."
|
||||
},
|
||||
|
||||
"assistant_id": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -2814,6 +2820,18 @@
|
||||
"description": "The number of results to skip.",
|
||||
"default": 0,
|
||||
"minimum": 0
|
||||
},
|
||||
"sort_by": {
|
||||
"type": "string",
|
||||
"enum": ["cron_id", "assistant_id", "thread_id", "next_run_date", "end_time", "created_at", "updated_at"],
|
||||
"title": "Sort By",
|
||||
"description": "The field to sort by."
|
||||
},
|
||||
"sort_order": {
|
||||
"type": "string",
|
||||
"enum": ["asc", "desc"],
|
||||
"title": "Sort Order",
|
||||
"description": "The order to sort by."
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "langgraph"
|
||||
version = "0.5.0rc1"
|
||||
version = "0.5.0"
|
||||
description = "Building stateful, multi-actor applications with LLMs"
|
||||
authors = []
|
||||
requires-python = ">=3.9"
|
||||
@@ -15,7 +15,7 @@ dependencies = [
|
||||
"langchain-core>=0.1",
|
||||
"langgraph-checkpoint>=2.1.0",
|
||||
"langgraph-sdk>=0.1.42",
|
||||
"langgraph-prebuilt>=0.5.0rc0",
|
||||
"langgraph-prebuilt>=0.5.0",
|
||||
"xxhash>=3.5.0",
|
||||
"pydantic>=2.7.4",
|
||||
]
|
||||
|
||||
@@ -40,6 +40,7 @@ from langgraph.checkpoint.base import (
|
||||
CheckpointTuple,
|
||||
)
|
||||
from langgraph.checkpoint.memory import InMemorySaver
|
||||
from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer
|
||||
from langgraph.constants import CONFIG_KEY_NODE_FINISHED, ERROR, PULL, START
|
||||
from langgraph.errors import InvalidUpdateError, NodeInterrupt, ParentCommand
|
||||
from langgraph.func import entrypoint, task
|
||||
@@ -106,6 +107,10 @@ async def test_checkpoint_errors() -> None:
|
||||
def get_next_version(self, current: Optional[int], channel: None) -> int:
|
||||
raise ValueError("Faulty get_next_version")
|
||||
|
||||
class FaultySerializer(JsonPlusSerializer):
|
||||
def dumps_typed(self, obj: Any) -> tuple[str, bytes]:
|
||||
raise ValueError("Faulty serializer")
|
||||
|
||||
def logic(inp: str) -> str:
|
||||
return ""
|
||||
|
||||
@@ -113,6 +118,18 @@ async def test_checkpoint_errors() -> None:
|
||||
builder.add_node("agent", logic)
|
||||
builder.add_edge(START, "agent")
|
||||
|
||||
graph = builder.compile(checkpointer=InMemorySaver(serde=FaultySerializer()))
|
||||
with pytest.raises(ValueError, match="Faulty serializer"):
|
||||
await graph.ainvoke("", {"configurable": {"thread_id": "thread-1"}})
|
||||
with pytest.raises(ValueError, match="Faulty serializer"):
|
||||
async for _ in graph.astream("", {"configurable": {"thread_id": "thread-2"}}):
|
||||
pass
|
||||
with pytest.raises(ValueError, match="Faulty serializer"):
|
||||
async for _ in graph.astream_events(
|
||||
"", {"configurable": {"thread_id": "thread-3"}}, version="v2"
|
||||
):
|
||||
pass
|
||||
|
||||
graph = builder.compile(checkpointer=FaultyGetCheckpointer())
|
||||
with pytest.raises(ValueError, match="Faulty get_tuple"):
|
||||
await graph.ainvoke("", {"configurable": {"thread_id": "thread-1"}})
|
||||
@@ -171,6 +188,25 @@ async def test_checkpoint_errors() -> None:
|
||||
):
|
||||
pass
|
||||
|
||||
def faulty_reducer(a: Any, b: Any) -> Any:
|
||||
raise ValueError("Faulty reducer")
|
||||
|
||||
builder = StateGraph(Annotated[str, faulty_reducer])
|
||||
builder.add_node("agent", logic)
|
||||
builder.add_edge(START, "agent")
|
||||
graph = builder.compile(checkpointer=InMemorySaver())
|
||||
|
||||
with pytest.raises(ValueError, match="Faulty reducer"):
|
||||
await graph.ainvoke("", {"configurable": {"thread_id": "thread-1"}})
|
||||
with pytest.raises(ValueError, match="Faulty reducer"):
|
||||
async for _ in graph.astream("", {"configurable": {"thread_id": "thread-2"}}):
|
||||
pass
|
||||
with pytest.raises(ValueError, match="Faulty reducer"):
|
||||
async for _ in graph.astream_events(
|
||||
"", {"configurable": {"thread_id": "thread-3"}}, version="v2"
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
async def test_py_async_with_cancel_behavior() -> None:
|
||||
"""This test confirms that in all versions of Python we support, __aexit__
|
||||
|
||||
Generated
+3
-3
@@ -1201,7 +1201,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "langgraph"
|
||||
version = "0.5.0rc1"
|
||||
version = "0.5.0"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "langchain-core" },
|
||||
@@ -1423,7 +1423,7 @@ inmem = [
|
||||
|
||||
[[package]]
|
||||
name = "langgraph-prebuilt"
|
||||
version = "0.5.0rc0"
|
||||
version = "0.5.0"
|
||||
source = { editable = "../prebuilt" }
|
||||
dependencies = [
|
||||
{ name = "langchain-core" },
|
||||
@@ -1471,7 +1471,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "langgraph-sdk"
|
||||
version = "0.1.71"
|
||||
version = "0.1.72"
|
||||
source = { editable = "../sdk-py" }
|
||||
dependencies = [
|
||||
{ name = "httpx" },
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "langgraph-prebuilt"
|
||||
version = "0.5.0rc0"
|
||||
version = "0.5.0"
|
||||
description = "Library with high-level APIs for creating and executing LangGraph agents and tools."
|
||||
authors = []
|
||||
requires-python = ">=3.9"
|
||||
|
||||
Generated
+3
-3
@@ -320,7 +320,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "langgraph"
|
||||
version = "0.5.0rc1"
|
||||
version = "0.5.0"
|
||||
source = { editable = "../langgraph" }
|
||||
dependencies = [
|
||||
{ name = "langchain-core" },
|
||||
@@ -464,7 +464,7 @@ dev = [
|
||||
|
||||
[[package]]
|
||||
name = "langgraph-prebuilt"
|
||||
version = "0.5.0rc0"
|
||||
version = "0.5.0"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "langchain-core" },
|
||||
@@ -511,7 +511,7 @@ dev = [
|
||||
|
||||
[[package]]
|
||||
name = "langgraph-sdk"
|
||||
version = "0.1.71"
|
||||
version = "0.1.72"
|
||||
source = { editable = "../sdk-py" }
|
||||
dependencies = [
|
||||
{ name = "httpx" },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@langchain/langgraph-sdk",
|
||||
"version": "0.0.85",
|
||||
"version": "0.0.86",
|
||||
"description": "Client library for interacting with the LangGraph API",
|
||||
"type": "module",
|
||||
"packageManager": "yarn@1.22.19",
|
||||
|
||||
@@ -178,6 +178,9 @@ export interface Cron {
|
||||
/** The ID of the cron */
|
||||
cron_id: string;
|
||||
|
||||
/** The ID of the assistant */
|
||||
assistant_id: string;
|
||||
|
||||
/** The ID of the thread */
|
||||
thread_id: Optional<string>;
|
||||
|
||||
@@ -195,6 +198,15 @@ export interface Cron {
|
||||
|
||||
/** The run payload to use for creating new run. */
|
||||
payload: Record<string, unknown>;
|
||||
|
||||
/** The user ID of the cron */
|
||||
user_id: Optional<string>;
|
||||
|
||||
/** The next run date of the cron */
|
||||
next_run_date: Optional<string>;
|
||||
|
||||
/** The metadata of the cron */
|
||||
metadata: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;
|
||||
|
||||
@@ -319,6 +319,8 @@ class Cron(TypedDict):
|
||||
|
||||
cron_id: str
|
||||
"""The ID of the cron."""
|
||||
assistant_id: str
|
||||
"""The ID of the assistant."""
|
||||
thread_id: str | None
|
||||
"""The ID of the thread."""
|
||||
end_time: datetime | None
|
||||
@@ -331,6 +333,12 @@ class Cron(TypedDict):
|
||||
"""The last time the cron was updated."""
|
||||
payload: dict
|
||||
"""The run payload to use for creating new run."""
|
||||
user_id: str | None
|
||||
"""The user ID of the cron."""
|
||||
next_run_date: datetime | None
|
||||
"""The next run date of the cron."""
|
||||
metadata: dict
|
||||
"""The metadata of the cron."""
|
||||
|
||||
|
||||
class RunCreate(TypedDict):
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "langgraph-sdk"
|
||||
version = "0.1.71"
|
||||
version = "0.1.72"
|
||||
description = "SDK for interacting with LangGraph API"
|
||||
authors = []
|
||||
requires-python = ">=3.9"
|
||||
|
||||
Generated
+1
-1
@@ -119,7 +119,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "langgraph-sdk"
|
||||
version = "0.1.71"
|
||||
version = "0.1.72"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "httpx" },
|
||||
|
||||
Reference in New Issue
Block a user