Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pipeline/preprocessors/link_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,15 @@ class LinkMap(TypedDict):
"SyncHttpClient": "langsmith/deployment/sdk/#langgraph_sdk.client.SyncHttpClient",
# Resource clients - Async
"AssistantsClient": "langsmith/deployment/sdk/#langgraph_sdk.client.AssistantsClient",
"AssistantsClient.create": "langsmith/deployment/sdk/#langgraph_sdk.client.AssistantsClient.create",
"AssistantsClient.update": "langsmith/deployment/sdk/#langgraph_sdk.client.AssistantsClient.update",
"ThreadsClient": "langsmith/deployment/sdk/#langgraph_sdk.client.ThreadsClient",
"ThreadsClient.create": "langsmith/deployment/sdk/#langgraph_sdk.client.ThreadsClient.create",
"ThreadsClient.copy": "langsmith/deployment/sdk/#langgraph_sdk.client.ThreadsClient.copy",
"ThreadsClient.search": "langsmith/deployment/sdk/#langgraph_sdk.client.ThreadsClient.search",
"ThreadsClient.get_history": "langsmith/deployment/sdk/#langgraph_sdk.client.ThreadsClient.get_history",
"RunsClient": "langsmith/deployment/sdk/#langgraph_sdk.client.RunsClient",
"RunsClient.stream": "langsmith/deployment/sdk/#langgraph_sdk.client.RunsClient.stream",
"CronClient": "langsmith/deployment/sdk/#langgraph_sdk.client.CronClient",
"StoreClient": "langsmith/deployment/sdk/#langgraph_sdk.client.StoreClient",
# Resource clients - Sync
Expand Down Expand Up @@ -327,6 +334,18 @@ class LinkMap(TypedDict):
"tool": "functions/_langchain_core.tools.tool.html",
"ToolNode": "classes/langchain.index.ToolNode.html",
"UsageMetadata": "types/_langchain_core.messages.UsageMetadata.html",
# LangSmith Deployment SDK - JS
"ThreadsClient": "classes/_langchain_langgraph-sdk.client.ThreadsClient.html",
"ThreadsClient.create": "classes/_langchain_langgraph-sdk.client.ThreadsClient.html#create",
"ThreadsClient.copy": "classes/_langchain_langgraph-sdk.client.ThreadsClient.html#copy",
"ThreadsClient.search": "classes/_langchain_langgraph-sdk.client.ThreadsClient.html#search",
"ThreadsClient.getHistory": "classes/_langchain_langgraph-sdk.client.ThreadsClient.html#gethistory",
"AssistantsClient": "classes/_langchain_langgraph-sdk.client.AssistantsClient.html",
"AssistantsClient.create": "classes/_langchain_langgraph-sdk.client.AssistantsClient.html#create",
"AssistantsClient.update": "classes/_langchain_langgraph-sdk.client.AssistantsClient.html#update",
"AssistantsClient.search": "classes/_langchain_langgraph-sdk.client.AssistantsClient.html#search",
"RunsClient": "classes/_langchain_langgraph-sdk.client.RunsClient.html",
"RunsClient.stream": "classes/_langchain_langgraph-sdk.client.RunsClient.html#stream",
},
},
]
Expand Down
8 changes: 4 additions & 4 deletions src/langsmith/add-auth-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebarTitle: Connect an authentication provider
---
In [the last tutorial](/langsmith/resource-auth), you added resource authorization to give users private conversations. However, you are still using hard-coded tokens for authentication, which is not secure. Now you'll replace those tokens with real user accounts using [OAuth2](/langsmith/deployment-quickstart).

You'll keep the same [`Auth`](/langsmith/langgraph-python-sdk#langgraph_sdk.auth.Auth) object and [resource-level access control](/langsmith/auth#single-owner-resources), but upgrade authentication to use Supabase as your identity provider. While Supabase is used in this tutorial, the concepts apply to any OAuth2 provider. You'll learn how to:
You'll keep the same @[`Auth`][Auth] object and [resource-level access control](/langsmith/auth#single-owner-resources), but upgrade authentication to use Supabase as your identity provider. While Supabase is used in this tutorial, the concepts apply to any OAuth2 provider. You'll learn how to:

1. Replace test tokens with real JWT tokens
2. Integrate with OAuth2 providers for secure user authentication
Expand Down Expand Up @@ -82,9 +82,9 @@ Since you're using Supabase for this, you can do this in the Supabase dashboard:

## 3. Implement token validation

In the previous tutorials, you used the [`Auth`](/langsmith/langgraph-python-sdk#langgraph_sdk.auth.Auth) object to [validate hard-coded tokens](/langsmith/set-up-custom-auth) and [add resource ownership](/langsmith/resource-auth).
In the previous tutorials, you used the @[`Auth`][Auth] object to [validate hard-coded tokens](/langsmith/set-up-custom-auth) and [add resource ownership](/langsmith/resource-auth).

Now you'll upgrade your authentication to validate real JWT tokens from Supabase. The main changes will all be in the [`@auth.authenticate`](/langsmith/langgraph-python-sdk#langgraph_sdk.auth.Auth.authenticate) decorated function:
Now you'll upgrade your authentication to validate real JWT tokens from Supabase. The main changes will all be in the @[`@auth.authenticate`][Auth.authenticate] decorated function:

* Instead of checking against a hard-coded list of tokens, you'll make an HTTP request to Supabase to validate the token.
* You'll extract real user information (ID, email) from the validated token.
Expand Down Expand Up @@ -278,4 +278,4 @@ Now that you have production authentication, consider:

1. Building a web UI with your preferred framework (see the [Custom Auth](https://github.com/langchain-ai/custom-auth) template for an example)
2. Learn more about the other aspects of authentication and authorization in the [conceptual guide on authentication](/langsmith/auth).
3. Customize your handlers and setup further after reading the [reference docs](/langsmith/langgraph-python-sdk#langgraph_sdk.auth.Auth).
3. Customize your handlers and setup further after reading the @[reference docs][Auth].
4 changes: 2 additions & 2 deletions src/langsmith/configuration-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ For more information on configurations, [see here](/langsmith/configuration-clou

### LangGraph SDK

To create an assistant, use the [LangGraph SDK](/langsmith/sdk) `create` method. See the [Python](/langsmith/langgraph-python-sdk#langgraph_sdk.client.AssistantsClient.create) and [JS](/langsmith/langgraph-js-ts-sdk#create) SDK reference docs for more information.
To create an assistant, use the [LangGraph SDK](/langsmith/sdk) `create` method. See the @[Python][AssistantsClient.create] and [JS](https://reference.langchain.com/javascript/classes/_langchain_langgraph-sdk.client.AssistantsClient.html#create) SDK reference docs for more information.

This example uses the same context schema as above, and creates an assistant with `model_name` set to `openai`.

Expand Down Expand Up @@ -231,7 +231,7 @@ Inside your deployment, select the "Assistants" tab. For the assistant you would

### LangGraph SDK

To edit the assistant, use the `update` method. This will create a new version of the assistant with the provided edits. See the [Python](/langsmith/langgraph-python-sdk#langgraph_sdk.client.AssistantsClient.update) and [JS](/langsmith/langgraph-js-ts-sdk#update) SDK reference docs for more information.
To edit the assistant, use the `update` method. This will create a new version of the assistant with the provided edits. See the @[Python][AssistantsClient.update] and [JS](https://reference.langchain.com/javascript/classes/_langchain_langgraph-sdk.client.AssistantsClient.html#update) SDK reference docs for more information.

<Note>
**Note**
Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/env-var.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ Time-to-live in seconds for resumable stream data in Redis.

When a run is created and the output is streamed, the stream can be configured to be resumable (e.g. `stream_resumable=True`). If a stream is resumable, output from the stream is temporarily stored in Redis. The TTL for this data can be configured by setting `RESUMABLE_STREAM_TTL_SECONDS`.

See the [Python](/langsmith/langgraph-python-sdk#langgraph_sdk.client.RunsClient.stream) and [JS/TS](https://langchain-ai.github.io/langgraphjs/reference/classes/sdk_client.RunsClient.html#stream) SDKs for more details on how to implement resumable streams.
See the @[Python][RunsClient.stream] and [JS/TS](https://langchain-ai.github.io/langgraphjs/reference/classes/sdk_client.RunsClient.html#stream) SDKs for more details on how to implement resumable streams.

Defaults to `120` seconds.
2 changes: 1 addition & 1 deletion src/langsmith/observability-concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ You can delete a project with one of the following ways:

- In the [LangSmith UI](https://smith.langchain.com), select the **Delete** option on the project's overflow menu.
- With the [`delete_tracer_sessions`](https://api.smith.langchain.com/redoc#tag/tracer-sessions/operation/delete_tracer_session_api_v1_sessions__session_id__delete) API endpoint
- With the `delete_project()` ([Python](/langsmith/smith-python-sdk)) or `deleteProject()` ([JS/TS](/langsmith/smith-js-ts-sdk)) in the LangSmith SDK.
- With the `delete_project()` ([Python](https://reference.langchain.com/python/langsmith/observability/sdk/)) or `deleteProject()` ([JS/TS](https://reference.langchain.com/javascript/modules/langsmith.html)) in the LangSmith SDK.

LangSmith does not support self-service deletion of individual traces.

Expand Down
6 changes: 3 additions & 3 deletions src/langsmith/resource-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Before you start this tutorial, ensure you have the [bot from the first tutorial

## 1. Add resource authorization

Recall that in the last tutorial, the [`Auth`](/langsmith/langgraph-python-sdk#langgraph_sdk.auth.Auth) object lets you register an [authentication function](/langsmith/auth#authentication), which LangSmith uses to validate the bearer tokens in incoming requests. Now you'll use it to register an **authorization** handler.
Recall that in the last tutorial, the @[`Auth`][Auth] object lets you register an [authentication function](/langsmith/auth#authentication), which LangSmith uses to validate the bearer tokens in incoming requests. Now you'll use it to register an **authorization** handler.

Authorization handlers are functions that run **after** authentication succeeds. These handlers can add [metadata](/langsmith/auth#filter-operations) to resources (like who owns them) and filter what each user can see.

Expand Down Expand Up @@ -107,7 +107,7 @@ async def add_owner(

The handler receives two parameters:

1. `ctx` ([AuthContext](/langsmith/langgraph-python-sdk#langgraph_sdk.auth.types.AuthContext)): contains info about the current `user`, the user's `permissions`, the `resource` ("threads", "crons", "assistants"), and the `action` being taken ("create", "read", "update", "delete", "search", "create_run")
1. `ctx` (@[AuthContext]): contains info about the current `user`, the user's `permissions`, the `resource` ("threads", "crons", "assistants"), and the `action` being taken ("create", "read", "update", "delete", "search", "create_run")
2. `value` (`dict`): data that is being created or accessed. The contents of this dict depend on the resource and action being accessed. See [adding scoped authorization handlers](#scoped-authorization) below for information on how to get more tightly scoped access control.

Notice that the simple handler does two things:
Expand Down Expand Up @@ -317,4 +317,4 @@ Now that you can control access to resources, you might want to:

1. Move on to [Connect an authentication provider](/langsmith/add-auth-server) to add real user accounts.
2. Read more about [authorization patterns](/langsmith/auth#authorization).
3. Check out the [API reference](/langsmith/langgraph-python-sdk#langgraph_sdk.auth.Auth) for details about the interfaces and methods used in this tutorial.
3. Check out the @[API reference][Auth] for details about the interfaces and methods used in this tutorial.
10 changes: 5 additions & 5 deletions src/langsmith/use-threads.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To run your graph and the state persisted, you must first create a thread.

### Empty thread

To create a new thread, use the [LangGraph SDK](/langsmith/sdk) `create` method. See the [Python](/langsmith/langgraph-python-sdk#langgraph_sdk.client.ThreadsClient.create) and [JS](/langsmith/langgraph-js-ts-sdk#create_3) SDK reference docs for more information.
To create a new thread, use the [LangGraph SDK](/langsmith/sdk) `create` method. See the @[Python][ThreadsClient.create] and [JS](https://reference.langchain.com/javascript/classes/_langchain_langgraph-sdk.client.ThreadsClient.html#create) SDK reference docs for more information.

<Tabs>
<Tab title="Python">
Expand Down Expand Up @@ -58,7 +58,7 @@ Output:

### Copy thread

Alternatively, if you already have a thread in your application whose state you wish to copy, you can use the `copy` method. This will create an independent thread whose history is identical to the original thread at the time of the operation. See the [Python](/langsmith/langgraph-python-sdk#langgraph_sdk.client.ThreadsClient.copy) and [JS](/langsmith/langgraph-js-ts-sdk#copy) SDK reference docs for more information.
Alternatively, if you already have a thread in your application whose state you wish to copy, you can use the `copy` method. This will create an independent thread whose history is identical to the original thread at the time of the operation. See the @[Python][ThreadsClient.copy] and [JS](https://reference.langchain.com/javascript/classes/_langchain_langgraph-sdk.client.ThreadsClient.html#copy) SDK reference docs for more information.

<Tabs>
<Tab title="Python">
Expand Down Expand Up @@ -239,11 +239,11 @@ Output:

### LangGraph SDK

To list threads, use the [LangGraph SDK](/langsmith/sdk) `search` method. This will list the threads in the application that match the provided filters. See the [Python](/langsmith/langgraph-python-sdk#langgraph_sdk.client.ThreadsClient.search) and [JS](/langsmith/langgraph-js-ts-sdk#search_2) SDK reference docs for more information.
To list threads, use the [LangGraph SDK](/langsmith/sdk) `search` method. This will list the threads in the application that match the provided filters. See the @[Python][ThreadsClient.search] and [JS](https://reference.langchain.com/javascript/classes/_langchain_langgraph-sdk.client.ThreadsClient.html#search) SDK reference docs for more information.

#### Filter by thread status

Use the `status` field to filter threads based on their status. Supported values are `idle`, `busy`, `interrupted`, and `error`. See [here](/langsmith/langgraph-python-sdk?h=thread+status#langgraph_sdk.auth.types.ThreadStatus) for information on each status. For example, to view `idle` threads:
Use the `status` field to filter threads based on their status. Supported values are `idle`, `busy`, `interrupted`, and `error`. See @[here][ThreadStatus] for information on each status. For example, to view `idle` threads:

<Tabs>
<Tab title="Python">
Expand Down Expand Up @@ -490,7 +490,7 @@ Optionally, to view the state of a thread at a given checkpoint, simply pass in

#### Inspect full thread history

To view a thread's history, use the `get_history` method. This returns a list of every state the thread experienced. For more information see the [Python](/langsmith/langgraph-python-sdk?h=thread+status#langgraph_sdk.client.ThreadsClient.get_history) and [JS](/langsmith/langgraph-js-ts-sdk#gethistory) reference docs.
To view a thread's history, use the `get_history` method. This returns a list of every state the thread experienced. For more information see the @[Python][ThreadsClient.get_history] and [JS](https://reference.langchain.com/javascript/classes/_langchain_langgraph-sdk.client.ThreadsClient.html#gethistory) reference docs.

### LangSmith UI

Expand Down