mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-08 10:47:52 +02:00
Main jtbd here:
a) clarify who/how a graph is being accessed and make the factory aware
of the `context` where relevant (and make it obvious when it is
available)
b) make it more clear when you can bypass / defer resources with
expensive lifespans (like MCp connections)
c) make auth access more type-safe.
Gives us room to add other information, like:
- langsmith distributed tracing information
---- old
Can start doing things like this:
```
def my_graph(runtime: ServerRuntime):
if runtime.ensure_user().permissions not in ("foo"):
raise ValueError("bar")
```
etc.
Points of expected confusion:
- You won't have a stream_writer in this context.
- This won't be an accessible object within the graph, only the graph
factory.
For maintainers, related draft PR int he server
https://github.com/langchain-ai/langgraph/pull/6774
9 lines
317 B
Python
9 lines
317 B
Python
from langgraph_sdk.auth import Auth
|
|
from langgraph_sdk.client import get_client, get_sync_client
|
|
from langgraph_sdk.encryption import Encryption
|
|
from langgraph_sdk.encryption.types import EncryptionContext
|
|
|
|
__version__ = "0.3.5"
|
|
|
|
__all__ = ["Auth", "Encryption", "EncryptionContext", "get_client", "get_sync_client"]
|