doc updates (#1639)

---------

Co-authored-by: vbarda <vadym@langchain.dev>
This commit is contained in:
Isaac Francisco
2024-09-08 16:55:52 +00:00
committed by GitHub
co-authored by vbarda
parent 38a644cf79
commit db306cd01b
98 changed files with 3227 additions and 978 deletions
+29 -10
View File
@@ -39,9 +39,20 @@
}
},
"source": [
"## Set up environment\n",
"## Setup\n",
"\n",
"We'll set up our environment variables for OpenAI, and optionally, to enable tracing with [LangSmith](https://smith.langchain.com)."
"First let's install our required packages and set our API keys"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4a4be247",
"metadata": {},
"outputs": [],
"source": [
"%capture --no-stderr\n",
"%pip install -U langgraph langchain_openai langchain_community"
]
},
{
@@ -60,21 +71,29 @@
},
"outputs": [],
"source": [
"import getpass\n",
"import os\n",
"\n",
"os.environ[\"OPENAI_API_KEY\"] = \"sk-...\"\n",
"os.environ[\"LANGSMITH_API_KEY\"] = \"lsv2_pt_...\"\n",
"os.environ[\"LANGCHAIN_TRACING_V2\"] = \"true\""
"\n",
"def _set_env(key: str):\n",
" if key not in os.environ:\n",
" os.environ[key] = getpass.getpass(f\"{key}:\")\n",
"\n",
"\n",
"_set_env(\"OPENAI_API_KEY\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "04d73c39-1cc9-4b94-a454-b0a4f604713c",
"cell_type": "markdown",
"id": "80559636",
"metadata": {},
"outputs": [],
"source": [
"os.environ[\"LANGCHAIN_PROJECT\"] = \"sql-agent\""
"<div class=\"admonition tip\">\n",
" <p class=\"admonition-title\">Set up <a href=\"https://smith.langchain.com\">LangSmith</a> for LangGraph development</p>\n",
" <p style=\"padding-top: 5px;\">\n",
" Sign up for LangSmith to quickly spot issues and improve the performance of your LangGraph projects. LangSmith lets you use trace data to debug, test, and monitor your LLM apps built with LangGraph — read more about how to get started <a href=\"https://docs.smith.langchain.com\">here</a>. \n",
" </p>\n",
"</div> "
]
},
{