先决条件
在开始之前,请确保您具备以下条件:- 一个 GitHub 账户
- 一个 LangSmith 账户(免费注册)
1. 在 GitHub 上创建仓库
要将应用程序部署到 LangSmith,您的应用程序代码必须驻留在 GitHub 仓库中。支持公共和私有仓库。对于本快速入门,请为您的应用程序使用new-langgraph-project 模板:
- 转到
new-langgraph-project仓库或new-langgraphjs-project模板。 - 单击右上角的
Fork按钮以将仓库分叉到您的 GitHub 账户。 - 单击 Create fork。
2. 部署到 LangSmith
- 登录到 LangSmith。
- 在左侧边栏中,选择 Deployments。
- 单击 + New Deployment 按钮。将打开一个窗格,您可以在其中填写必填字段。
- 如果您是首次用户或添加以前未连接的私有仓库,请单击 Import from GitHub 按钮并按照说明连接您的 GitHub 账户。
- 选择您的新 LangGraph 项目仓库。
- 单击 Submit 进行部署。 这可能需要大约 15 分钟才能完成。您可以在 Deployment details 视图中检查状态。
3. 在 Studio 中测试您的应用程序
应用程序部署后:- 选择您刚刚创建的部署以查看更多详细信息。
- 单击右上角的 Studio 按钮。Studio 将打开以显示您的图。
4. 获取部署的 API URL
- 在 Deployment details 视图中,单击 API URL 以将其复制到剪贴板。
- 单击
URL以将其复制到剪贴板。
5. Test the API
You can now test the API:- Python SDK (Async)
- Python SDK (Sync)
- JavaScript SDK
- Rest API
- Install the LangGraph Python SDK:
- Send a message to the assistant (threadless run):
Next steps
You’ve successfully deployed your application to LangSmith Cloud. Here are some next steps:- Explore Studio: Use Studio to visualize and debug your graph interactively.
- Monitor your app: Set up observability with traces, dashboards, and alerts.
- Learn more about Cloud: See the complete Cloud setup guide for all configuration options.