repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: '🛠️ LangSmith' |
| #3 | description: 'Integrate with Langsmith to debug and monitor your LLM app' |
| #4 | --- |
| #5 | |
| #6 | Embedchain now supports integration with [LangSmith](https://www.langchain.com/langsmith). |
| #7 | |
| #8 | To use LangSmith, you need to do the following steps. |
| #9 | |
| #10 | 1. Have an account on LangSmith and keep the environment variables in handy |
| #11 | 2. Set the environment variables in your app so that embedchain has context about it. |
| #12 | 3. Just use embedchain and everything will be logged to LangSmith, so that you can better test and monitor your application. |
| #13 | |
| #14 | Let's cover each step in detail. |
| #15 | |
| #16 | |
| #17 | * First make sure that you have created a LangSmith account and have all the necessary variables handy. LangSmith has a [good documentation](https://docs.smith.langchain.com/) on how to get started with their service. |
| #18 | |
| #19 | * Once you have setup the account, we will need the following environment variables |
| #20 | |
| #21 | ```bash |
| #22 | # Setting environment variable for LangChain Tracing V2 integration. |
| #23 | export LANGCHAIN_TRACING_V2=true |
| #24 | |
| #25 | # Setting the API endpoint for LangChain. |
| #26 | export LANGCHAIN_ENDPOINT=https://api.smith.langchain.com |
| #27 | |
| #28 | # Replace '<your-api-key>' with your LangChain API key. |
| #29 | export LANGCHAIN_API_KEY=<your-api-key> |
| #30 | |
| #31 | # Replace '<your-project>' with your LangChain project name, or it defaults to "default". |
| #32 | export LANGCHAIN_PROJECT=<your-project> # if not specified, defaults to "default" |
| #33 | ``` |
| #34 | |
| #35 | If you are using Python, you can use the following code to set environment variables |
| #36 | |
| #37 | ```python |
| #38 | import os |
| #39 | |
| #40 | # Setting environment variable for LangChain Tracing V2 integration. |
| #41 | os.environ['LANGCHAIN_TRACING_V2'] = 'true' |
| #42 | |
| #43 | # Setting the API endpoint for LangChain. |
| #44 | os.environ['LANGCHAIN_ENDPOINT'] = 'https://api.smith.langchain.com' |
| #45 | |
| #46 | # Replace '<your-api-key>' with your LangChain API key. |
| #47 | os.environ['LANGCHAIN_API_KEY'] = '<your-api-key>' |
| #48 | |
| #49 | # Replace '<your-project>' with your LangChain project name. |
| #50 | os.environ['LANGCHAIN_PROJECT'] = '<your-project>' |
| #51 | ``` |
| #52 | |
| #53 | * Now create an app using Embedchain and everything will be automatically visible in the LangSmith |
| #54 | |
| #55 | |
| #56 | ```python |
| #57 | from embedchain import App |
| #58 | |
| #59 | # Initialize EmbedChain application. |
| #60 | app = App() |
| #61 | |
| #62 | # Add data to your app |
| #63 | app.add("https://en.wikipedia.org/wiki/Elon_Musk") |
| #64 | |
| #65 | # Query your app |
| #66 | app.query("How many companies did Elon found?") |
| #67 | ``` |
| #68 | |
| #69 | * Now the entire log for this will be visible in langsmith. |
| #70 | |
| #71 | <img src="/images/langsmith.png"/> |
| #72 |