diff --git a/.github/workflows/_integration_test.yml b/.github/workflows/_integration_test.yml index e6452c637..5857609ec 100644 --- a/.github/workflows/_integration_test.yml +++ b/.github/workflows/_integration_test.yml @@ -3,6 +3,9 @@ name: CLI integration test on: workflow_call: +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.yml index 585c232df..68c9a78f3 100644 --- a/.github/workflows/_lint.yml +++ b/.github/workflows/_lint.yml @@ -8,6 +8,9 @@ on: type: string description: "From which folder this pipeline executes" +permissions: + contents: read + env: # This env var allows us to get inline annotations when ruff has complaints. RUFF_OUTPUT_FORMAT: github diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index c572e96cb..6fb763003 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -8,6 +8,9 @@ on: type: string description: "From which folder this pipeline executes" +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/_test_langgraph.yml b/.github/workflows/_test_langgraph.yml index 0a8b515ea..df09511e7 100644 --- a/.github/workflows/_test_langgraph.yml +++ b/.github/workflows/_test_langgraph.yml @@ -3,6 +3,9 @@ name: test on: workflow_call: +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index a89bf8b3f..9b2c7cd71 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -7,6 +7,9 @@ on: paths: - "libs/**" +permissions: + contents: read + jobs: benchmark: runs-on: ubuntu-latest diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index e3eba31ac..f5484badb 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -5,6 +5,9 @@ on: paths: - "libs/**" +permissions: + contents: read + jobs: benchmark: runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43752eddf..9ee07bc32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: branches: [main] pull_request: +permissions: + contents: read + # If another push to the same PR or branch happens while this workflow is still running, # cancel the earlier run in favor of the next run. # diff --git a/.github/workflows/link_check.yml b/.github/workflows/link_check.yml index 05897c215..65e041e7b 100644 --- a/.github/workflows/link_check.yml +++ b/.github/workflows/link_check.yml @@ -11,6 +11,9 @@ on: - cron: "0 5 * * *" workflow_dispatch: +permissions: + contents: read + jobs: markdown-link-check: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e91f25804..78461653c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,9 @@ on: type: string default: "libs/langgraph" +permissions: + contents: read + env: PYTHON_VERSION: "3.11" diff --git a/.github/workflows/release_js.yml b/.github/workflows/release_js.yml index 70617d6f1..bce535330 100644 --- a/.github/workflows/release_js.yml +++ b/.github/workflows/release_js.yml @@ -3,6 +3,9 @@ name: JS Release on: workflow_dispatch: +permissions: + contents: read + jobs: publish: # Disallow publishing from branches that aren't `main`. diff --git a/.github/workflows/run_notebooks.yml b/.github/workflows/run_notebooks.yml index da49980cd..975df0191 100644 --- a/.github/workflows/run_notebooks.yml +++ b/.github/workflows/run_notebooks.yml @@ -11,6 +11,9 @@ on: schedule: - cron: "0 13 * * *" +permissions: + contents: read + defaults: run: working-directory: docs diff --git a/libs/cli/uv.lock b/libs/cli/uv.lock index b52c20443..6aa8ab193 100644 --- a/libs/cli/uv.lock +++ b/libs/cli/uv.lock @@ -462,7 +462,7 @@ wheels = [ [[package]] name = "langgraph" -version = "0.5.0" +version = "0.5.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "langchain-core", marker = "python_full_version >= '3.11'" }, @@ -472,9 +472,9 @@ dependencies = [ { name = "pydantic", marker = "python_full_version >= '3.11'" }, { name = "xxhash", marker = "python_full_version >= '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9b/5f/f08123cbfa0384b6a4011a9547fdbca52b53d51d69b21ff2a03332fde694/langgraph-0.5.0.tar.gz", hash = "sha256:7ad6d42f2a44e93e225cc65c59fac51c55ae549c9824adc22971d00e5ac26443", size = 434232, upload-time = "2025-06-26T22:55:18.068Z" } +sdist = { url = "https://files.pythonhosted.org/packages/72/db/864d8e6c6e921f27b357980d0cfca847366238c1bb8a6bffd766f651004e/langgraph-0.5.1.tar.gz", hash = "sha256:312d341979e38034dde60e08df53505b8a196619df1266d6eacf6b002a0a65a8", size = 437339, upload-time = "2025-07-02T21:15:56.581Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d2/a4/0d5551ef675d382497765c74cdd893e2758d2dc2041e0f3671f110761a04/langgraph-0.5.0-py3-none-any.whl", hash = "sha256:74e33efb6527602b79bfcc4e3d0bfbb15b8d86fa25bb417fdd8d3306456cf8de", size = 143658, upload-time = "2025-06-26T22:55:16.599Z" }, + { url = "https://files.pythonhosted.org/packages/4d/fa/69e83057b7a6062c0785deccdd22610003611c16cac7b4218b4b87c4924a/langgraph-0.5.1-py3-none-any.whl", hash = "sha256:707f0cc0d2713011fff4578bf57de8226cd96bcc0679868be2f41eb0984bb5af", size = 143695, upload-time = "2025-07-02T21:15:55.148Z" }, ] [[package]] diff --git a/libs/langgraph/langgraph/graph/state.py b/libs/langgraph/langgraph/graph/state.py index 8a094c6c4..b0311d8ab 100644 --- a/libs/langgraph/langgraph/graph/state.py +++ b/libs/langgraph/langgraph/graph/state.py @@ -831,6 +831,10 @@ class CompiledStateGraph( self.builder = builder self.schema_to_mapper = schema_to_mapper + def get_input_jsonschema( + self, config: RunnableConfig | None = None + ) -> dict[str, Any]: + return _get_json_schema( def get_input_jsonschema( self, config: RunnableConfig | None = None ) -> dict[str, Any]: @@ -841,8 +845,11 @@ class CompiledStateGraph( name=self.get_name("Input"), ) + def get_output_jsonschema( def get_output_jsonschema( self, config: RunnableConfig | None = None + ) -> dict[str, Any]: + return _get_json_schema( ) -> dict[str, Any]: return _get_json_schema( typ=self.builder.output_schema, @@ -1311,14 +1318,19 @@ def _is_field_managed_value(name: str, typ: type[Any]) -> ManagedValueSpec | Non return None +def _get_json_schema( def _get_json_schema( typ: type, schemas: dict, channels: dict, name: str, +) -> dict[str, Any]: ) -> dict[str, Any]: if isclass(typ) and issubclass(typ, BaseModel): return typ.model_json_schema() + elif is_typeddict(typ): + return TypeAdapter(typ).json_schema() + return typ.model_json_schema() elif is_typeddict(typ): return TypeAdapter(typ).json_schema() else: @@ -1328,6 +1340,7 @@ def _get_json_schema( name, root=(channels[keys[0]].UpdateType, None), ).model_json_schema() + ).model_json_schema() else: return create_model( name, diff --git a/libs/langgraph/pyproject.toml b/libs/langgraph/pyproject.toml index 1d5518052..a8dbae74b 100644 --- a/libs/langgraph/pyproject.toml +++ b/libs/langgraph/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "langgraph" -version = "0.5.0" +version = "0.5.1" description = "Building stateful, multi-actor applications with LLMs" authors = [] requires-python = ">=3.9" diff --git a/libs/langgraph/uv.lock b/libs/langgraph/uv.lock index af9948b00..4404a7d67 100644 --- a/libs/langgraph/uv.lock +++ b/libs/langgraph/uv.lock @@ -1195,7 +1195,7 @@ wheels = [ [[package]] name = "langgraph" -version = "0.5.0" +version = "0.5.1" source = { editable = "." } dependencies = [ { name = "langchain-core" }, @@ -3092,6 +3092,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", size = 14552, upload-time = "2025-05-21T18:55:22.152Z" }, ] +[[package]] +name = "typing-inspection" +version = "0.4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f8/b1/0c11f5058406b3af7609f121aaa6b609744687f1d158b3c3a5bf4cc94238/typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28", size = 75726, upload-time = "2025-05-21T18:55:23.885Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", size = 14552, upload-time = "2025-05-21T18:55:22.152Z" }, +] + [[package]] name = "tzdata" version = "2025.2" diff --git a/libs/prebuilt/uv.lock b/libs/prebuilt/uv.lock index 3f4430eb8..7d399a39f 100644 --- a/libs/prebuilt/uv.lock +++ b/libs/prebuilt/uv.lock @@ -320,7 +320,7 @@ wheels = [ [[package]] name = "langgraph" -version = "0.5.0" +version = "0.5.1" source = { editable = "../langgraph" } dependencies = [ { name = "langchain-core" },