Skip to content

Commit

Permalink
Merge branch 'main' of github.com:langchain-ai/langchainjs into 7496
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jan 18, 2025
2 parents 5cdddf3 + 1546a2e commit cc17941
Show file tree
Hide file tree
Showing 162 changed files with 10,082 additions and 363 deletions.
4 changes: 2 additions & 2 deletions cookbook/basic_critique_revise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"outputs": [],
"source": [
"Deno.env.set(\"OPENAI_API_KEY\", \"\");\n",
"Deno.env.set(\"LANGCHAIN_API_KEY\", \"\");\n",
"Deno.env.set(\"LANGCHAIN_TRACING_V2\", \"true\");\n",
"Deno.env.set(\"LANGSMITH_API_KEY\", \"\");\n",
"Deno.env.set(\"LANGSMITH_TRACING\", \"true\");\n",
"\n",
"import { z } from \"npm:zod\";\n",
"\n",
Expand Down
82 changes: 43 additions & 39 deletions docs/core_docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ yarn-error.log*

/.quarto/
# AUTO_GENERATED_DOCS
docs/tutorials/summarization.md
docs/tutorials/summarization.mdx
docs/tutorials/sql_qa.md
docs/tutorials/sql_qa.mdx
docs/tutorials/retrievers.md
docs/tutorials/retrievers.mdx
docs/tutorials/rag.md
docs/tutorials/rag.mdx
docs/tutorials/query_analysis.md
docs/tutorials/query_analysis.mdx
docs/tutorials/qa_chat_history.md
docs/tutorials/qa_chat_history.mdx
docs/tutorials/pdf_qa.md
docs/tutorials/pdf_qa.mdx
docs/tutorials/local_rag.md
docs/tutorials/local_rag.mdx
docs/tutorials/llm_chain.md
docs/tutorials/llm_chain.mdx
docs/tutorials/graph.md
Expand All @@ -54,8 +54,6 @@ docs/tutorials/classification.md
docs/tutorials/classification.mdx
docs/tutorials/chatbot.md
docs/tutorials/chatbot.mdx
docs/concepts/t.md
docs/concepts/t.mdx
docs/how_to/trim_messages.md
docs/how_to/trim_messages.mdx
docs/how_to/tools_prompting.md
Expand Down Expand Up @@ -218,6 +216,8 @@ docs/how_to/assign.md
docs/how_to/assign.mdx
docs/how_to/agent_executor.md
docs/how_to/agent_executor.mdx
docs/concepts/t.md
docs/concepts/t.mdx
docs/versions/migrating_memory/conversation_summary_memory.md
docs/versions/migrating_memory/conversation_summary_memory.mdx
docs/versions/migrating_memory/conversation_buffer_window_memory.md
Expand All @@ -226,6 +226,12 @@ docs/versions/migrating_memory/chat_history.md
docs/versions/migrating_memory/chat_history.mdx
docs/troubleshooting/errors/INVALID_TOOL_RESULTS.md
docs/troubleshooting/errors/INVALID_TOOL_RESULTS.mdx
docs/integrations/toolkits/vectorstore.md
docs/integrations/toolkits/vectorstore.mdx
docs/integrations/toolkits/sql.md
docs/integrations/toolkits/sql.mdx
docs/integrations/toolkits/openapi.md
docs/integrations/toolkits/openapi.mdx
docs/integrations/vectorstores/weaviate.md
docs/integrations/vectorstores/weaviate.mdx
docs/integrations/vectorstores/upstash.md
Expand All @@ -252,22 +258,10 @@ docs/integrations/vectorstores/elasticsearch.md
docs/integrations/vectorstores/elasticsearch.mdx
docs/integrations/vectorstores/chroma.md
docs/integrations/vectorstores/chroma.mdx
docs/integrations/tools/tavily_search.md
docs/integrations/tools/tavily_search.mdx
docs/integrations/tools/serpapi.md
docs/integrations/tools/serpapi.mdx
docs/integrations/tools/google_scholar.md
docs/integrations/tools/google_scholar.mdx
docs/integrations/tools/exa_search.md
docs/integrations/tools/exa_search.mdx
docs/integrations/tools/duckduckgo_search.md
docs/integrations/tools/duckduckgo_search.mdx
docs/integrations/toolkits/vectorstore.md
docs/integrations/toolkits/vectorstore.mdx
docs/integrations/toolkits/sql.md
docs/integrations/toolkits/sql.mdx
docs/integrations/toolkits/openapi.md
docs/integrations/toolkits/openapi.mdx
docs/integrations/stores/in_memory.md
docs/integrations/stores/in_memory.mdx
docs/integrations/stores/file_system.md
docs/integrations/stores/file_system.mdx
docs/integrations/text_embedding/togetherai.md
docs/integrations/text_embedding/togetherai.mdx
docs/integrations/text_embedding/pinecone.md
Expand All @@ -290,14 +284,12 @@ docs/integrations/text_embedding/cohere.md
docs/integrations/text_embedding/cohere.mdx
docs/integrations/text_embedding/cloudflare_ai.md
docs/integrations/text_embedding/cloudflare_ai.mdx
docs/integrations/text_embedding/bytedance_doubao.md
docs/integrations/text_embedding/bytedance_doubao.mdx
docs/integrations/text_embedding/bedrock.md
docs/integrations/text_embedding/bedrock.mdx
docs/integrations/text_embedding/azure_openai.md
docs/integrations/text_embedding/azure_openai.mdx
docs/integrations/stores/in_memory.md
docs/integrations/stores/in_memory.mdx
docs/integrations/stores/file_system.md
docs/integrations/stores/file_system.mdx
docs/integrations/retrievers/tavily.md
docs/integrations/retrievers/tavily.mdx
docs/integrations/retrievers/kendra-retriever.md
Expand Down Expand Up @@ -360,6 +352,8 @@ docs/integrations/chat/cohere.md
docs/integrations/chat/cohere.mdx
docs/integrations/chat/cloudflare_workersai.md
docs/integrations/chat/cloudflare_workersai.mdx
docs/integrations/chat/cerebras.md
docs/integrations/chat/cerebras.mdx
docs/integrations/chat/bedrock_converse.md
docs/integrations/chat/bedrock_converse.mdx
docs/integrations/chat/bedrock.md
Expand All @@ -370,6 +364,16 @@ docs/integrations/chat/arcjet.md
docs/integrations/chat/arcjet.mdx
docs/integrations/chat/anthropic.md
docs/integrations/chat/anthropic.mdx
docs/integrations/tools/tavily_search.md
docs/integrations/tools/tavily_search.mdx
docs/integrations/tools/serpapi.md
docs/integrations/tools/serpapi.mdx
docs/integrations/tools/google_scholar.md
docs/integrations/tools/google_scholar.mdx
docs/integrations/tools/exa_search.md
docs/integrations/tools/exa_search.mdx
docs/integrations/tools/duckduckgo_search.md
docs/integrations/tools/duckduckgo_search.mdx
docs/integrations/retrievers/self_query/weaviate.md
docs/integrations/retrievers/self_query/weaviate.mdx
docs/integrations/retrievers/self_query/vectara.md
Expand All @@ -386,6 +390,16 @@ docs/integrations/retrievers/self_query/hnswlib.md
docs/integrations/retrievers/self_query/hnswlib.mdx
docs/integrations/retrievers/self_query/chroma.md
docs/integrations/retrievers/self_query/chroma.mdx
docs/integrations/document_loaders/file_loaders/unstructured.md
docs/integrations/document_loaders/file_loaders/unstructured.mdx
docs/integrations/document_loaders/file_loaders/text.md
docs/integrations/document_loaders/file_loaders/text.mdx
docs/integrations/document_loaders/file_loaders/pdf.md
docs/integrations/document_loaders/file_loaders/pdf.mdx
docs/integrations/document_loaders/file_loaders/directory.md
docs/integrations/document_loaders/file_loaders/directory.mdx
docs/integrations/document_loaders/file_loaders/csv.md
docs/integrations/document_loaders/file_loaders/csv.mdx
docs/integrations/document_loaders/web_loaders/web_puppeteer.md
docs/integrations/document_loaders/web_loaders/web_puppeteer.mdx
docs/integrations/document_loaders/web_loaders/web_cheerio.md
Expand All @@ -397,14 +411,4 @@ docs/integrations/document_loaders/web_loaders/pdf.mdx
docs/integrations/document_loaders/web_loaders/langsmith.md
docs/integrations/document_loaders/web_loaders/langsmith.mdx
docs/integrations/document_loaders/web_loaders/firecrawl.md
docs/integrations/document_loaders/web_loaders/firecrawl.mdx
docs/integrations/document_loaders/file_loaders/unstructured.md
docs/integrations/document_loaders/file_loaders/unstructured.mdx
docs/integrations/document_loaders/file_loaders/text.md
docs/integrations/document_loaders/file_loaders/text.mdx
docs/integrations/document_loaders/file_loaders/pdf.md
docs/integrations/document_loaders/file_loaders/pdf.mdx
docs/integrations/document_loaders/file_loaders/directory.md
docs/integrations/document_loaders/file_loaders/directory.mdx
docs/integrations/document_loaders/file_loaders/csv.md
docs/integrations/document_loaders/file_loaders/csv.mdx
docs/integrations/document_loaders/web_loaders/firecrawl.mdx
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/agent_executor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"After you sign up at the link above, make sure to set your environment variables to start logging traces:\n",
"\n",
"```shell\n",
"export LANGCHAIN_TRACING_V2=\"true\"\n",
"export LANGCHAIN_API_KEY=\"...\"\n",
"export LANGSMITH_TRACING=\"true\"\n",
"export LANGSMITH_API_KEY=\"...\"\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ The best way to do this is with [LangSmith](https://smith.langchain.com).
After you sign up at the link above, make sure to set your environment variables to start logging traces:

```shell
export LANGCHAIN_TRACING_V2="true"
export LANGCHAIN_API_KEY="..."
export LANGSMITH_TRACING="true"
export LANGSMITH_API_KEY="..."

# Reduce tracing latency if you are not in a serverless environment
# export LANGCHAIN_CALLBACKS_BACKGROUND=true
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/graph_constructing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/graph_mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/graph_prompting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/graph_semantic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/core_docs/docs/how_to/migrate_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"// process.env.OPENAI_API_KEY = \"...\";\n",
"\n",
"// Optional, add tracing in LangSmith\n",
"// process.env.LANGCHAIN_API_KEY = \"ls...\";\n",
"// process.env.LANGSMITH_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\";\n",
"// process.env.LANGSMITH_TRACING = \"true\";\n",
"// process.env.LANGSMITH_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\";"
Expand Down Expand Up @@ -1337,4 +1337,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/qa_chat_history_how_to.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"\n",
"\n",
"```bash\n",
"export LANGCHAIN_TRACING_V2=true\n",
"export LANGCHAIN_API_KEY=YOUR_KEY\n",
"export LANGSMITH_TRACING=true\n",
"export LANGSMITH_API_KEY=YOUR_KEY\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/qa_citations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"\n",
"\n",
"```bash\n",
"export LANGCHAIN_TRACING_V2=true\n",
"export LANGCHAIN_API_KEY=YOUR_KEY\n",
"export LANGSMITH_TRACING=true\n",
"export LANGSMITH_API_KEY=YOUR_KEY\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/qa_per_user.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/qa_sources.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"\n",
"\n",
"```bash\n",
"export LANGCHAIN_TRACING_V2=true\n",
"export LANGCHAIN_API_KEY=YOUR_KEY\n",
"export LANGSMITH_TRACING=true\n",
"export LANGSMITH_API_KEY=YOUR_KEY\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/qa_streaming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"\n",
"\n",
"```bash\n",
"export LANGCHAIN_TRACING_V2=true\n",
"export LANGCHAIN_API_KEY=YOUR_KEY\n",
"export LANGSMITH_TRACING=true\n",
"export LANGSMITH_API_KEY=YOUR_KEY\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# export LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/query_few_shot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"```\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/query_high_cardinality.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"```\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/query_multiple_queries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/query_multiple_retrievers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/docs/how_to/query_no_queries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"\n",
"# Optional, use LangSmith for best-in-class observability\n",
"LANGSMITH_API_KEY=your-api-key\n",
"LANGCHAIN_TRACING_V2=true\n",
"LANGSMITH_TRACING=true\n",
"\n",
"# Reduce tracing latency if you are not in a serverless environment\n",
"# LANGCHAIN_CALLBACKS_BACKGROUND=true\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/sql_large_db.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ npm install langchain @langchain/community @langchain/openai typeorm sqlite3
```bash
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
# export LANGSMITH_API_KEY="your api key"
# export LANGSMITH_TRACING=true

# Reduce tracing latency if you are not in a serverless environment
# export LANGCHAIN_CALLBACKS_BACKGROUND=true
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/sql_prompting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ npm install @langchain/community @langchain/openai typeorm sqlite3
```bash
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
# export LANGSMITH_API_KEY="your api key"
# export LANGSMITH_TRACING=true

# Reduce tracing latency if you are not in a serverless environment
# export LANGCHAIN_CALLBACKS_BACKGROUND=true
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/sql_query_checking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ npm install @langchain/community @langchain/openai typeorm sqlite3
```bash
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
# export LANGSMITH_API_KEY="your api key"
# export LANGSMITH_TRACING=true

# Reduce tracing latency if you are not in a serverless environment
# export LANGCHAIN_CALLBACKS_BACKGROUND=true
Expand Down
4 changes: 2 additions & 2 deletions docs/core_docs/docs/how_to/tool_calling_parallel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"});\n",
"\n",
"const multiplyTool = tool(async ({ a, b }) => {\n",
" return a + b;\n",
" return a * b;\n",
"}, {\n",
" name: \"multiply\",\n",
" description: \"Multiplies a and b\",\n",
Expand Down Expand Up @@ -220,4 +220,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Loading

0 comments on commit cc17941

Please sign in to comment.