Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
36 changes: 18 additions & 18 deletions 01-Basic/04-LangSmith-Tracking-Setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"\n",
"## Overview\n",
"\n",
"This tutorial covers how to set up and use LangSmith, a powerful platform for developing, monitoring, and testing LLM applications. \n",
"LangSmith provides comprehensive tracking capabilities that are essential for understanding and optimizing your LLM applications.\n",
"This tutorial covers how to set up and use `LangSmith`, a powerful platform for developing, monitoring, and testing LLM applications. \n",
"`LangSmith` provides comprehensive tracking capabilities that are essential for understanding and optimizing your LLM applications.\n",
"\n",
"LangSmith tracking helps you monitor:\n",
"`LangSmith` tracking helps you monitor:\n",
"\n",
"Token usage and associated costs\n",
"- Token usage and associated costs\n",
"- Execution time and performance metrics\n",
"- Error rates and unexpected behaviors\n",
"- Agent interactions and chain operations\n",
"\n",
"In this tutorial, we'll walk through the process of setting up LangSmith tracking and integrating it with your LangChain applications.\n",
"In this tutorial, we'll walk through the process of setting up `LangSmith` tracking and integrating it with your `LangChain` applications.\n",
"\n",
"### Table of Contents\n",
"\n",
Expand All @@ -48,8 +48,8 @@
"source": [
"## Setting up a LangSmith trace\n",
"\n",
"LangSmith is a platform for developing, monitoring, and testing LLM applications. \n",
"If you're starting a project or learning LangChain, LangSmith is a must-have to get set up and running."
"`LangSmith` is a platform for developing, monitoring, and testing LLM applications. \n",
"If you're starting a project or learning `LangChain`, `LangSmith` is a must-have to get set up and running."
]
},
{
Expand Down Expand Up @@ -100,7 +100,7 @@
"\n",
"1. Go to https://smith.langchain.com/ and sign up.\n",
"2. After signing up, you will need to verify your email.\n",
"3. Click the left cog (Setting) - centre \"Personal\" - \"Create API Key\" to get an API key.\n",
"3. Click the left cog (Setting) - center \"Personal\" - \"Create API Key\" to get an API key.\n",
"\n",
"![get-api-key](./assets/03-langsmith-tracking-setup-04.png)\n",
"\n"
Expand All @@ -110,7 +110,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"set environment variables is in `.env`.\n",
"Set environment variables is in the `.env` file.\n",
"\n",
"Copy the contents of `.env_sample` and load it into your `.env` with the key you set.\n"
]
Expand Down Expand Up @@ -140,7 +140,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In Description, enter a description that makes sense to you and click the Create API Key button to create it.\n",
"In Description, enter a description that makes sense to you and click the Create API Key button.\n",
"\n",
"![create-api-key](./assets/03-langsmith-tracking-setup-05.png\n",
")\n"
Expand All @@ -167,10 +167,10 @@
"\n",
"First, enter the key you received from LangSmith and your project information in the .env file.\n",
"\n",
"- LANGCHAIN_TRACING_V2: Set to \"true\" to start tracking.\n",
"- LANGCHAIN_ENDPOINT: https://api.smith.langchain.com Do not change.\n",
"- LANGCHAIN_API_KEY: Enter the key issued in the previous step.\n",
"- LANGCHAIN_PROJECT: If you enter a project name, all runs will be traced to that project group.\n",
"- `LANGCHAIN_TRACING_V2`: Set to \"true\" to start tracking.\n",
"- `LANGCHAIN_ENDPOINT`: https://api.smith.langchain.com (Do not modify this value).\n",
"- `LANGCHAIN_API_KEY`: Enter the key you received in the previous step.\n",
"- `LANGCHAIN_PROJECT`: Specify a project name to group and trace all runs under that project group.\n",
"\n",
"![setting-api-key](./assets/03-langsmith-tracking-setup-07.png)\n",
"\n"
Expand All @@ -184,7 +184,7 @@
"\n",
"Enabling tracking is very simple. All you need to do is set an environment variable.\n",
"\n",
"Copy the contents of .env_sample and load it into your .env with the key you set for Bonnie."
"Copy the contents of `.env_sample` and load it into your `.env` with the key you set"
]
},
{
Expand Down Expand Up @@ -223,7 +223,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"As long as your traces are enabled and your API key and project name are set correctly, this should be sufficient.\n",
"As long as your traces are enabled and your API key and project name are set correctly, tracking will work properly.\n",
"\n",
"However, if you want to change the project name or change the tracking, you can do so with the code below."
]
Expand All @@ -238,7 +238,7 @@
"\n",
"os.environ[\"LANGCHAIN_TRACING_V2\"] = \"true\"\n",
"os.environ[\"LANGCHAIN_ENDPOINT\"] = \"https://api.smith.langchain.com\"\n",
"os.environ[\"LANGCHAIN_PROJECT\"] = \"<LangChain Peoject Name>\"\n",
"os.environ[\"LANGCHAIN_PROJECT\"] = \"<LangChain Project Name>\"\n",
"os.environ[\"LANGCHAIN_API_KEY\"] = \"<LangChain API KEY>\""
]
}
Expand All @@ -264,4 +264,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Loading