From ff12555bdc934ba0714c46194637b5d3d77d21e7 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Mon, 19 May 2025 18:06:37 -0500 Subject: [PATCH] docs: clarify hub.pull behavior with non-US LangSmith endpoints (#31270) **Description**: This PR updates the documentation to address a potential issue when using `hub.pull(...)` with non-US LangSmith endpoints (e.g., `https://eu.api.smith.langchain.com`). By default, the `hub.pull` function assumes the non US-based API URL. When the `LANGSMITH_ENDPOINT` environment variable is set to a non-US region, this can lead to `LangSmithNotFoundError 404 not found` errors when pulling public assets from the LangChain Hub. Issue: #31191 --------- Co-authored-by: Chester Curme --- docs/docs/tutorials/rag.ipynb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/tutorials/rag.ipynb b/docs/docs/tutorials/rag.ipynb index a4601ce3a21..189c650346f 100644 --- a/docs/docs/tutorials/rag.ipynb +++ b/docs/docs/tutorials/rag.ipynb @@ -234,6 +234,8 @@ "_ = vector_store.add_documents(documents=all_splits)\n", "\n", "# Define prompt for question-answering\n", + "# N.B. for non-US LangSmith endpoints, you may need to specify\n", + "# api_url=\"https://api.smith.langchain.com\" in hub.pull.\n", "prompt = hub.pull(\"rlm/rag-prompt\")\n", "\n", "\n", @@ -535,7 +537,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "46f378c5-858c-488f-8aef-8b59a6280791", "metadata": {}, "outputs": [ @@ -553,6 +555,8 @@ "source": [ "from langchain import hub\n", "\n", + "# N.B. for non-US LangSmith endpoints, you may need to specify\n", + "# api_url=\"https://api.smith.langchain.com\" in hub.pull.\n", "prompt = hub.pull(\"rlm/rag-prompt\")\n", "\n", "example_messages = prompt.invoke(\n",