From f1ae405f7ba6b31e7f46ee8e605ee61a76eb12a0 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Wed, 24 Jul 2024 13:55:52 -0700 Subject: [PATCH] Adds callback backgrounding env var in more places (#6196) --- docs/core_docs/docs/concepts.mdx | 3 +++ docs/core_docs/docs/how_to/agent_executor.ipynb | 3 +++ docs/core_docs/docs/how_to/debugging.mdx | 3 +++ .../docs/how_to/graph_constructing.ipynb | 3 +++ docs/core_docs/docs/how_to/graph_mapping.ipynb | 3 +++ docs/core_docs/docs/how_to/graph_prompting.ipynb | 3 +++ docs/core_docs/docs/how_to/graph_semantic.ipynb | 3 +++ docs/core_docs/docs/how_to/message_history.mdx | 3 +++ docs/core_docs/docs/how_to/migrate_agent.ipynb | 5 ++++- .../docs/how_to/qa_chat_history_how_to.ipynb | 3 +++ docs/core_docs/docs/how_to/qa_citations.ipynb | 3 +++ docs/core_docs/docs/how_to/qa_per_user.ipynb | 3 +++ docs/core_docs/docs/how_to/qa_sources.ipynb | 3 +++ docs/core_docs/docs/how_to/qa_streaming.ipynb | 3 +++ docs/core_docs/docs/how_to/query_few_shot.ipynb | 3 +++ .../docs/how_to/query_high_cardinality.ipynb | 3 +++ .../docs/how_to/query_multiple_queries.ipynb | 3 +++ .../docs/how_to/query_multiple_retrievers.ipynb | 3 +++ .../core_docs/docs/how_to/query_no_queries.ipynb | 3 +++ docs/core_docs/docs/how_to/sql_large_db.mdx | 3 +++ docs/core_docs/docs/how_to/sql_prompting.mdx | 3 +++ .../core_docs/docs/how_to/sql_query_checking.mdx | 3 +++ docs/core_docs/docs/how_to/tools_prompting.ipynb | 3 +++ docs/core_docs/docs/tutorials/agents.mdx | 3 +++ docs/core_docs/docs/tutorials/chatbot.ipynb | 3 +++ docs/core_docs/docs/tutorials/extraction.ipynb | 3 +++ docs/core_docs/docs/tutorials/graph.ipynb | 3 +++ docs/core_docs/docs/tutorials/llm_chain.ipynb | 3 +++ docs/core_docs/docs/tutorials/local_rag.ipynb | 3 +++ .../docs/tutorials/qa_chat_history.ipynb | 16 ++++++---------- .../docs/tutorials/query_analysis.ipynb | 3 +++ docs/core_docs/docs/tutorials/rag.ipynb | 3 +++ docs/core_docs/docs/tutorials/sql_qa.mdx | 3 +++ 33 files changed, 103 insertions(+), 11 deletions(-) diff --git a/docs/core_docs/docs/concepts.mdx b/docs/core_docs/docs/concepts.mdx index 84c48cdcaedb..93ae85ab9b68 100644 --- a/docs/core_docs/docs/concepts.mdx +++ b/docs/core_docs/docs/concepts.mdx @@ -72,6 +72,9 @@ After that, you can enable it by setting environment variables: ```shell export LANGCHAIN_TRACING_V2=true export LANGCHAIN_API_KEY=ls__... + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` ## LangChain Expression Language diff --git a/docs/core_docs/docs/how_to/agent_executor.ipynb b/docs/core_docs/docs/how_to/agent_executor.ipynb index 630c52d8aff1..1d68a826feff 100644 --- a/docs/core_docs/docs/how_to/agent_executor.ipynb +++ b/docs/core_docs/docs/how_to/agent_executor.ipynb @@ -67,6 +67,9 @@ "```shell\n", "export LANGCHAIN_TRACING_V2=\"true\"\n", "export LANGCHAIN_API_KEY=\"...\"\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n" ] }, diff --git a/docs/core_docs/docs/how_to/debugging.mdx b/docs/core_docs/docs/how_to/debugging.mdx index 2e93a2396536..dd92e4b15587 100644 --- a/docs/core_docs/docs/how_to/debugging.mdx +++ b/docs/core_docs/docs/how_to/debugging.mdx @@ -18,6 +18,9 @@ After you sign up at the link above, make sure to set your environment variables ```shell export LANGCHAIN_TRACING_V2="true" export LANGCHAIN_API_KEY="..." + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` Let's suppose we have an agent, and want to visualize the actions it takes and tool outputs it receives. Without any debugging, here's what we see: diff --git a/docs/core_docs/docs/how_to/graph_constructing.ipynb b/docs/core_docs/docs/how_to/graph_constructing.ipynb index 6e8b44adec70..8a78dc81aee4 100644 --- a/docs/core_docs/docs/how_to/graph_constructing.ipynb +++ b/docs/core_docs/docs/how_to/graph_constructing.ipynb @@ -42,6 +42,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n", "\n", "Next, we need to define Neo4j credentials.\n", diff --git a/docs/core_docs/docs/how_to/graph_mapping.ipynb b/docs/core_docs/docs/how_to/graph_mapping.ipynb index 60c3ebd6b027..f715f75b9c5e 100644 --- a/docs/core_docs/docs/how_to/graph_mapping.ipynb +++ b/docs/core_docs/docs/how_to/graph_mapping.ipynb @@ -41,6 +41,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n", "\n", "Next, we need to define Neo4j credentials.\n", diff --git a/docs/core_docs/docs/how_to/graph_prompting.ipynb b/docs/core_docs/docs/how_to/graph_prompting.ipynb index 73fca7deda39..6d3a442d279e 100644 --- a/docs/core_docs/docs/how_to/graph_prompting.ipynb +++ b/docs/core_docs/docs/how_to/graph_prompting.ipynb @@ -37,6 +37,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n", "\n", "Next, we need to define Neo4j credentials.\n", diff --git a/docs/core_docs/docs/how_to/graph_semantic.ipynb b/docs/core_docs/docs/how_to/graph_semantic.ipynb index aec3aaf4f1d8..36f335e304b4 100644 --- a/docs/core_docs/docs/how_to/graph_semantic.ipynb +++ b/docs/core_docs/docs/how_to/graph_semantic.ipynb @@ -44,6 +44,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n", "\n", "Next, we need to define Neo4j credentials.\n", diff --git a/docs/core_docs/docs/how_to/message_history.mdx b/docs/core_docs/docs/how_to/message_history.mdx index a3443322ed69..fe1c9c294c39 100644 --- a/docs/core_docs/docs/how_to/message_history.mdx +++ b/docs/core_docs/docs/how_to/message_history.mdx @@ -48,6 +48,9 @@ If you do want to use LangSmith, after you sign up at the link above, make sure ```bash export LANGCHAIN_TRACING_V2="true" export LANGCHAIN_API_KEY="" + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` Let's create a simple runnable that takes a dict as input and returns a `BaseMessage`. diff --git a/docs/core_docs/docs/how_to/migrate_agent.ipynb b/docs/core_docs/docs/how_to/migrate_agent.ipynb index f91cd3fd2454..26f5e0d5136c 100644 --- a/docs/core_docs/docs/how_to/migrate_agent.ipynb +++ b/docs/core_docs/docs/how_to/migrate_agent.ipynb @@ -60,7 +60,10 @@ "// process.env.LANGCHAIN_API_KEY = \"ls...\";\n", "// process.env.LANGCHAIN_CALLBACKS_BACKGROUND = \"true\";\n", "// process.env.LANGCHAIN_TRACING_V2 = \"true\";\n", - "// process.env.LANGCHAIN_PROJECT = \"How to migrate: LangGraphJS\";" + "// process.env.LANGCHAIN_PROJECT = \"How to migrate: LangGraphJS\";\n", + "\n", + "// Reduce tracing latency if you are not in a serverless environment\n", + "// process.env.LANGCHAIN_CALLBACKS_BACKGROUND = \"true\";" ] }, { diff --git a/docs/core_docs/docs/how_to/qa_chat_history_how_to.ipynb b/docs/core_docs/docs/how_to/qa_chat_history_how_to.ipynb index 2e276e92f1e2..db2f63d19198 100644 --- a/docs/core_docs/docs/how_to/qa_chat_history_how_to.ipynb +++ b/docs/core_docs/docs/how_to/qa_chat_history_how_to.ipynb @@ -60,6 +60,9 @@ "```bash\n", "export LANGCHAIN_TRACING_V2=true\n", "export LANGCHAIN_API_KEY=YOUR_KEY\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/qa_citations.ipynb b/docs/core_docs/docs/how_to/qa_citations.ipynb index cfcce3a490bd..4069fe97b022 100644 --- a/docs/core_docs/docs/how_to/qa_citations.ipynb +++ b/docs/core_docs/docs/how_to/qa_citations.ipynb @@ -57,6 +57,9 @@ "```bash\n", "export LANGCHAIN_TRACING_V2=true\n", "export LANGCHAIN_API_KEY=YOUR_KEY\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/qa_per_user.ipynb b/docs/core_docs/docs/how_to/qa_per_user.ipynb index 4e29ca6dd5b7..d3aa48764ece 100644 --- a/docs/core_docs/docs/how_to/qa_per_user.ipynb +++ b/docs/core_docs/docs/how_to/qa_per_user.ipynb @@ -89,6 +89,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/qa_sources.ipynb b/docs/core_docs/docs/how_to/qa_sources.ipynb index 142f40e5909a..dde30197c953 100644 --- a/docs/core_docs/docs/how_to/qa_sources.ipynb +++ b/docs/core_docs/docs/how_to/qa_sources.ipynb @@ -55,6 +55,9 @@ "```bash\n", "export LANGCHAIN_TRACING_V2=true\n", "export LANGCHAIN_API_KEY=YOUR_KEY\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/qa_streaming.ipynb b/docs/core_docs/docs/how_to/qa_streaming.ipynb index 6a301673dc3e..882938a3eb9c 100644 --- a/docs/core_docs/docs/how_to/qa_streaming.ipynb +++ b/docs/core_docs/docs/how_to/qa_streaming.ipynb @@ -55,6 +55,9 @@ "```bash\n", "export LANGCHAIN_TRACING_V2=true\n", "export LANGCHAIN_API_KEY=YOUR_KEY\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/query_few_shot.ipynb b/docs/core_docs/docs/how_to/query_few_shot.ipynb index ce094a5bbdef..63c91e179561 100644 --- a/docs/core_docs/docs/how_to/query_few_shot.ipynb +++ b/docs/core_docs/docs/how_to/query_few_shot.ipynb @@ -46,6 +46,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/query_high_cardinality.ipynb b/docs/core_docs/docs/how_to/query_high_cardinality.ipynb index 251e8c988f13..b07798438704 100644 --- a/docs/core_docs/docs/how_to/query_high_cardinality.ipynb +++ b/docs/core_docs/docs/how_to/query_high_cardinality.ipynb @@ -48,6 +48,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/query_multiple_queries.ipynb b/docs/core_docs/docs/how_to/query_multiple_queries.ipynb index 67712988d1ea..acac9787666a 100644 --- a/docs/core_docs/docs/how_to/query_multiple_queries.ipynb +++ b/docs/core_docs/docs/how_to/query_multiple_queries.ipynb @@ -46,6 +46,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/query_multiple_retrievers.ipynb b/docs/core_docs/docs/how_to/query_multiple_retrievers.ipynb index 933f5f49593e..74962e8e7634 100644 --- a/docs/core_docs/docs/how_to/query_multiple_retrievers.ipynb +++ b/docs/core_docs/docs/how_to/query_multiple_retrievers.ipynb @@ -46,6 +46,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/query_no_queries.ipynb b/docs/core_docs/docs/how_to/query_no_queries.ipynb index 171f5ac8dda1..a97d0e7541d0 100644 --- a/docs/core_docs/docs/how_to/query_no_queries.ipynb +++ b/docs/core_docs/docs/how_to/query_no_queries.ipynb @@ -48,6 +48,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/how_to/sql_large_db.mdx b/docs/core_docs/docs/how_to/sql_large_db.mdx index 8ce512bc8fc2..9c4895632d0e 100644 --- a/docs/core_docs/docs/how_to/sql_large_db.mdx +++ b/docs/core_docs/docs/how_to/sql_large_db.mdx @@ -25,6 +25,9 @@ export OPENAI_API_KEY="your api key" # Uncomment the below to use LangSmith. Not required. # export LANGCHAIN_API_KEY="your api key" # export LANGCHAIN_TRACING_V2=true + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` The below example will use a SQLite connection with Chinook database. Follow these [installation steps](https://database.guide/2-sample-databases-sqlite/) to create `Chinook.db` in the same directory as this notebook: diff --git a/docs/core_docs/docs/how_to/sql_prompting.mdx b/docs/core_docs/docs/how_to/sql_prompting.mdx index 827fd147a224..5cfbc2879cd2 100644 --- a/docs/core_docs/docs/how_to/sql_prompting.mdx +++ b/docs/core_docs/docs/how_to/sql_prompting.mdx @@ -24,6 +24,9 @@ export OPENAI_API_KEY="your api key" # Uncomment the below to use LangSmith. Not required. # export LANGCHAIN_API_KEY="your api key" # export LANGCHAIN_TRACING_V2=true + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` The below example will use a SQLite connection with Chinook database. Follow these [installation steps](https://database.guide/2-sample-databases-sqlite/) to create `Chinook.db` in the same directory as this notebook: diff --git a/docs/core_docs/docs/how_to/sql_query_checking.mdx b/docs/core_docs/docs/how_to/sql_query_checking.mdx index 66505a175256..7cb5146b6e8b 100644 --- a/docs/core_docs/docs/how_to/sql_query_checking.mdx +++ b/docs/core_docs/docs/how_to/sql_query_checking.mdx @@ -28,6 +28,9 @@ export OPENAI_API_KEY="your api key" # Uncomment the below to use LangSmith. Not required. # export LANGCHAIN_API_KEY="your api key" # export LANGCHAIN_TRACING_V2=true + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` The below example will use a SQLite connection with Chinook database. Follow these [installation steps](https://database.guide/2-sample-databases-sqlite/) to create `Chinook.db` in the same directory as this notebook: diff --git a/docs/core_docs/docs/how_to/tools_prompting.ipynb b/docs/core_docs/docs/how_to/tools_prompting.ipynb index a5ac5aa739d8..be665e49604c 100644 --- a/docs/core_docs/docs/how_to/tools_prompting.ipynb +++ b/docs/core_docs/docs/how_to/tools_prompting.ipynb @@ -53,6 +53,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/tutorials/agents.mdx b/docs/core_docs/docs/tutorials/agents.mdx index abf836f1f152..6176affc1a07 100644 --- a/docs/core_docs/docs/tutorials/agents.mdx +++ b/docs/core_docs/docs/tutorials/agents.mdx @@ -31,6 +31,9 @@ When building with LangChain, all steps will automatically be traced in LangSmit ```bash export LANGCHAIN_TRACING_V2="true" export LANGCHAIN_API_KEY="" + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` ## Define tools diff --git a/docs/core_docs/docs/tutorials/chatbot.ipynb b/docs/core_docs/docs/tutorials/chatbot.ipynb index 90baa457d9e1..ea09b0aa4199 100644 --- a/docs/core_docs/docs/tutorials/chatbot.ipynb +++ b/docs/core_docs/docs/tutorials/chatbot.ipynb @@ -71,6 +71,9 @@ "```shell\n", "export LANGCHAIN_TRACING_V2=\"true\"\n", "export LANGCHAIN_API_KEY=\"...\"\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n", "\n", "## Quickstart\n", diff --git a/docs/core_docs/docs/tutorials/extraction.ipynb b/docs/core_docs/docs/tutorials/extraction.ipynb index e1a17a350f0b..696550cf3fc2 100644 --- a/docs/core_docs/docs/tutorials/extraction.ipynb +++ b/docs/core_docs/docs/tutorials/extraction.ipynb @@ -66,6 +66,9 @@ "```shell\n", "export LANGCHAIN_TRACING_V2=\"true\"\n", "export LANGCHAIN_API_KEY=\"...\"\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/tutorials/graph.ipynb b/docs/core_docs/docs/tutorials/graph.ipynb index 240f6014f6e3..723fdf971cbf 100644 --- a/docs/core_docs/docs/tutorials/graph.ipynb +++ b/docs/core_docs/docs/tutorials/graph.ipynb @@ -62,6 +62,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n", "\n", "Next, we need to define Neo4j credentials.\n", diff --git a/docs/core_docs/docs/tutorials/llm_chain.ipynb b/docs/core_docs/docs/tutorials/llm_chain.ipynb index 59791535b5e8..592fef3cb35b 100644 --- a/docs/core_docs/docs/tutorials/llm_chain.ipynb +++ b/docs/core_docs/docs/tutorials/llm_chain.ipynb @@ -61,6 +61,9 @@ "```shell\n", "export LANGCHAIN_TRACING_V2=\"true\"\n", "export LANGCHAIN_API_KEY=\"...\"\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/tutorials/local_rag.ipynb b/docs/core_docs/docs/tutorials/local_rag.ipynb index be5cc79bbdd1..ca3d7a6af086 100644 --- a/docs/core_docs/docs/tutorials/local_rag.ipynb +++ b/docs/core_docs/docs/tutorials/local_rag.ipynb @@ -40,6 +40,9 @@ "```bash\n", "export LANGCHAIN_TRACING_V2=true\n", "export LANGCHAIN_API_KEY=YOUR_KEY\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/tutorials/qa_chat_history.ipynb b/docs/core_docs/docs/tutorials/qa_chat_history.ipynb index 73e71987570d..6c0c9f3e8c03 100644 --- a/docs/core_docs/docs/tutorials/qa_chat_history.ipynb +++ b/docs/core_docs/docs/tutorials/qa_chat_history.ipynb @@ -68,6 +68,9 @@ "```bash\n", "export LANGCHAIN_TRACING_V2=true\n", "export LANGCHAIN_API_KEY=YOUR_KEY\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, @@ -80,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -92,15 +95,8 @@ "import { pull } from \"langchain/hub\";\n", "import { ChatPromptTemplate } from \"@langchain/core/prompts\";\n", "import { RunnableSequence, RunnablePassthrough } from \"@langchain/core/runnables\";\n", - "import { StringOutputParser } from \"@langchain/core/output_parsers\";" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ + "import { StringOutputParser } from \"@langchain/core/output_parsers\";\n", + "\n", "import { createStuffDocumentsChain } from \"langchain/chains/combine_documents\";\n", "\n", "const loader = new CheerioWebBaseLoader(\n", diff --git a/docs/core_docs/docs/tutorials/query_analysis.ipynb b/docs/core_docs/docs/tutorials/query_analysis.ipynb index 26a5287eb85d..18c879293ced 100644 --- a/docs/core_docs/docs/tutorials/query_analysis.ipynb +++ b/docs/core_docs/docs/tutorials/query_analysis.ipynb @@ -69,6 +69,9 @@ "# Optional, use LangSmith for best-in-class observability\n", "LANGSMITH_API_KEY=your-api-key\n", "LANGCHAIN_TRACING_V2=true\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```" ] }, diff --git a/docs/core_docs/docs/tutorials/rag.ipynb b/docs/core_docs/docs/tutorials/rag.ipynb index b7fbcbc1a44f..7e48f61db958 100644 --- a/docs/core_docs/docs/tutorials/rag.ipynb +++ b/docs/core_docs/docs/tutorials/rag.ipynb @@ -74,6 +74,9 @@ "```shell\n", "export LANGCHAIN_TRACING_V2=\"true\"\n", "export LANGCHAIN_API_KEY=\"...\"\n", + "\n", + "# Reduce tracing latency if you are not in a serverless environment\n", + "# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n", "```\n", "\n", "```{=mdx}\n", diff --git a/docs/core_docs/docs/tutorials/sql_qa.mdx b/docs/core_docs/docs/tutorials/sql_qa.mdx index 1357b9f45665..d0e0d2001424 100644 --- a/docs/core_docs/docs/tutorials/sql_qa.mdx +++ b/docs/core_docs/docs/tutorials/sql_qa.mdx @@ -51,6 +51,9 @@ export OPENAI_API_KEY= # Uncomment the below to use LangSmith. Not required, but recommended for debugging and observability. # export LANGCHAIN_API_KEY= # export LANGCHAIN_TRACING_V2=true + +# Reduce tracing latency if you are not in a serverless environment +# export LANGCHAIN_CALLBACKS_BACKGROUND=true ``` import CodeBlock from "@theme/CodeBlock";