LangGraph Studio 故障排除¶
Safari连接问题¶
Safari会阻止本地主机上的普通HTTP流量。当使用langgraph dev
运行Studio时,可能会看到“Failed to load assistants”错误。
解决方案1:使用Cloudflare Tunnel¶
该命令输出格式如下URL:
https://smith.langchain.com/studio/?baseUrl=https://hamilton-praise-heart-costumes.trycloudflare.com
在Safari中使用此URL加载Studio。此处的baseUrl
参数指定您的代理服务器端点。
解决方案2:使用Chromium浏览器¶
Chrome及其他基于Chromium的浏览器允许在本地主机上使用HTTP。使用langgraph dev
无需额外配置。
Brave 连接问题¶
当启用 Brave Shields 时,Brave 会阻止本地主机上的普通 HTTP 流量。在使用 langgraph dev
运行 Studio 时,你可能会看到“Failed to load assistants”(无法加载助手)的错误。
解决方案 1:禁用 Brave Shields¶
通过 URL 栏中的 Brave 图标,为 LangSmith 禁用 Brave Shields。
解决方案 2:使用 Cloudflare Tunnel¶
该命令将输出如下格式的 URL:
https://smith.langchain.com/studio/?baseUrl=https://hamilton-praise-heart-costumes.trycloudflare.com
在 Brave 中使用此 URL 加载 Studio。此处,baseUrl
参数指定了你的代理服务器端点。
图形边问题¶
未定义的条件边可能会在你的图中显示意外的连接。这是因为没有正确定义时,LangGraph Studio 会假设条件边可以访问所有其他节点。为了解决这个问题,请使用以下方法之一显式定义路由路径:
解决方案 1:路径映射¶
定义路由器输出与目标节点之间的映射:
解决方案 2:路由器类型定义(Python)¶
使用 Python 的 Literal
类型指定可能的路由目的地: