-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'langchain-ai:master' into codespace-cuddly-guide-97j7vq…
…547qqgh7wv9
- Loading branch information
Showing
782 changed files
with
27,053 additions
and
49,284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
name: API docs build | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 13 * * *' | ||
env: | ||
POETRY_VERSION: "1.8.1" | ||
PYTHON_VERSION: "3.11" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: langchain | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-api-docs-html | ||
path: langchain-api-docs-html | ||
token: ${{ secrets.TOKEN_GITHUB_API_DOCS_HTML }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-google | ||
path: langchain-google | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-datastax | ||
path: langchain-datastax | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-nvidia | ||
path: langchain-nvidia | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-cohere | ||
path: langchain-cohere | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-elastic | ||
path: langchain-elastic | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-postgres | ||
path: langchain-postgres | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-aws | ||
path: langchain-aws | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-weaviate | ||
path: langchain-weaviate | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-ai21 | ||
path: langchain-ai21 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-together | ||
path: langchain-together | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: langchain-ai/langchain-experimental | ||
path: langchain-experimental | ||
|
||
|
||
- name: Set Git config | ||
working-directory: langchain | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "Github Actions" | ||
- name: Move google libs | ||
run: | | ||
rm -rf \ | ||
langchain/libs/partners/google-genai \ | ||
langchain/libs/partners/google-vertexai \ | ||
langchain/libs/partners/astradb \ | ||
langchain/libs/partners/nvidia-trt \ | ||
langchain/libs/partners/nvidia-ai-endpoints \ | ||
langchain/libs/partners/cohere \ | ||
langchain/libs/partners/elasticsearch \ | ||
langchain/libs/partners/upstage \ | ||
langchain/libs/partners/ai21 \ | ||
langchain/libs/partners/together \ | ||
langchain/libs/standard-tests \ | ||
langchain/libs/experimental | ||
mv langchain-google/libs/genai langchain/libs/partners/google-genai | ||
mv langchain-google/libs/vertexai langchain/libs/partners/google-vertexai | ||
mv langchain-google/libs/community langchain/libs/partners/google-community | ||
# mv langchain-datastax/libs/astradb langchain/libs/partners/astradb | ||
# mv langchain-nvidia/libs/ai-endpoints langchain/libs/partners/nvidia-ai-endpoints | ||
mv langchain-cohere/libs/cohere langchain/libs/partners/cohere | ||
mv langchain-elastic/libs/elasticsearch langchain/libs/partners/elasticsearch | ||
mv langchain-postgres langchain/libs/partners/postgres | ||
mv langchain-aws/libs/aws langchain/libs/partners/aws | ||
mv langchain-weaviate/libs/weaviate langchain/libs/partners/weaviate | ||
mv langchain-ai21/libs/ai21 langchain/libs/partners/ai21 | ||
mv langchain-together/libs/together langchain/libs/partners/together | ||
mv langchain-experimental/libs/experimental langchain/libs/experimental | ||
- name: Rm old html | ||
run: | ||
rm -rf langchain-api-docs-html/api_reference_build/html | ||
|
||
- name: Set up Python ${{ env.PYTHON_VERSION }} + Poetry ${{ env.POETRY_VERSION }} | ||
uses: "./langchain/.github/actions/poetry_setup" | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
cache-key: api-docs | ||
working-directory: langchain | ||
|
||
- name: Install dependencies | ||
working-directory: langchain | ||
run: | | ||
python -m pip install -U uv | ||
python -m uv pip install --upgrade --no-cache-dir pip setuptools | ||
# skip airbyte and ibm due to pandas dependency issue | ||
python -m uv pip install $(ls ./libs/partners | grep -vE "airbyte|ibm" | xargs -I {} echo "./libs/partners/{}") | ||
python -m uv pip install libs/core libs/langchain libs/text-splitters libs/community libs/experimental | ||
python -m uv pip install -r docs/api_reference/requirements.txt | ||
- name: Build docs | ||
working-directory: langchain | ||
run: | | ||
python docs/api_reference/create_api_rst.py | ||
python -m sphinx -T -E -b html -d ../langchain-api-docs-html/_build/doctrees -c docs/api_reference docs/api_reference ../langchain-api-docs-html/api_reference_build/html -j auto | ||
python docs/api_reference/scripts/custom_formatter.py ../langchain-api-docs-html/api_reference_build/html | ||
# Default index page is blank so we copy in the actual home page. | ||
cp ../langchain-api-docs-html/api_reference_build/html/{reference,index}.html | ||
rm -rf ../langchain-api-docs-html/_build/ | ||
# https://github.com/marketplace/actions/add-commit | ||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
cwd: langchain-api-docs-html | ||
message: 'Update API docs build' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Run notebooks | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
python_version: | ||
description: 'Python version' | ||
required: false | ||
default: '3.11' | ||
working-directory: | ||
description: 'Working directory or subset (e.g., docs/docs/tutorials/llm_chain.ipynb)' | ||
required: false | ||
default: 'all' | ||
schedule: | ||
- cron: '0 13 * * *' | ||
|
||
env: | ||
POETRY_VERSION: "1.7.1" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
name: "Test docs" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python + Poetry ${{ env.POETRY_VERSION }} | ||
uses: "./.github/actions/poetry_setup" | ||
with: | ||
python-version: ${{ github.event.inputs.python_version || '3.11' }} | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
working-directory: ${{ inputs.working-directory }} | ||
cache-key: run-notebooks | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -e libs/core | ||
pip install -e libs/langchain | ||
pip install -e libs/community | ||
pip install --upgrade langchain-experimental | ||
pip install -e libs//partners/anthropic | ||
pip install -e libs//partners/chroma | ||
pip install -e libs//partners/openai | ||
pip install -e libs//partners/mistralai | ||
pip install jupyter langgraph click pypdf vcrpy | ||
- name: Pre-download tiktoken files | ||
run: | | ||
python docs/scripts/download_tiktoken.py | ||
- name: Prepare notebooks | ||
run: | | ||
python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells | ||
- name: Run notebooks | ||
env: | ||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }} | ||
run: | | ||
./docs/scripts/execute_notebooks.sh ${{ github.event.inputs.working-directory || 'all' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.