langgraph-sdk 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- .PHONY: lint format
1
+ .PHONY: lint format test
2
2
 
3
3
  test:
4
- echo "No tests to run"
4
+ uv run pytest tests
5
5
 
6
6
  ######################
7
7
  # LINTING AND FORMATTING
@@ -18,6 +18,7 @@ lint lint_diff:
18
18
  [ "$(PYTHON_FILES)" = "" ] || uv run ruff format $(PYTHON_FILES) --diff
19
19
  [ "$(PYTHON_FILES)" = "" ] || uv run ruff check --select I $(PYTHON_FILES)
20
20
  [ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) || uv run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
21
+ uvx ty check .
21
22
 
22
23
  format format_diff:
23
24
  uv run ruff check --select I --fix $(PYTHON_FILES)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-sdk
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: SDK for interacting with LangGraph API
5
5
  Project-URL: Repository, https://www.github.com/langchain-ai/langgraph
6
6
  License-Expression: MIT
@@ -0,0 +1,6 @@
1
+ from langgraph_sdk.auth import Auth
2
+ from langgraph_sdk.client import get_client, get_sync_client
3
+
4
+ __version__ = "0.2.1"
5
+
6
+ __all__ = ["Auth", "get_client", "get_sync_client"]
@@ -701,7 +701,7 @@ def _validate_handler(fn: Callable[..., typing.Any]) -> None:
701
701
  """
702
702
  if not inspect.iscoroutinefunction(fn):
703
703
  raise ValueError(
704
- f"Auth handler '{fn.__name__}' must be an async function. "
704
+ f"Auth handler '{getattr(fn, '__name__', fn)}' must be an async function. "
705
705
  "Add 'async' before 'def' to make it asynchronous and ensure"
706
706
  " any IO operations are non-blocking."
707
707
  )
@@ -709,18 +709,20 @@ def _validate_handler(fn: Callable[..., typing.Any]) -> None:
709
709
  sig = inspect.signature(fn)
710
710
  if "ctx" not in sig.parameters:
711
711
  raise ValueError(
712
- f"Auth handler '{fn.__name__}' must have a 'ctx: AuthContext' parameter. "
712
+ f"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'ctx: AuthContext' parameter. "
713
713
  "Update the function signature to include this required parameter."
714
714
  )
715
715
  if "value" not in sig.parameters:
716
716
  raise ValueError(
717
- f"Auth handler '{fn.__name__}' must have a 'value' parameter. "
717
+ f"Auth handler '{getattr(fn, '__name__', fn)}' must have a 'value' parameter. "
718
718
  " The value contains the mutable data being sent to the endpoint."
719
719
  "Update the function signature to include this required parameter."
720
720
  )
721
721
 
722
722
 
723
- def is_studio_user(user: types.MinimalUser | types.User | types.UserDict) -> bool:
723
+ def is_studio_user(
724
+ user: types.MinimalUser | types.BaseUser | types.MinimalUserDict,
725
+ ) -> bool:
724
726
  return (
725
727
  isinstance(user, types.StudioUser)
726
728
  or isinstance(user, dict)