Skip to content

Commit

Permalink
Merge branch 'main' into wfh/anthropic-again
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 authored Jan 24, 2025
2 parents 0c4d42a + fe0cb1f commit be14abf
Show file tree
Hide file tree
Showing 1,530 changed files with 206,738 additions and 5,571 deletions.
13 changes: 5 additions & 8 deletions .github/actions/js-integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ inputs:
node-version:
description: "Node version"
required: true
langchain-api-key:
langchain-api-key-beta:
description: "Langchain"
required: true
langchain-endpoint:
description: "LangSmith Endpoint"
required: true
openai-api-key:
description: "OpenAI API key"
required: false
Expand All @@ -36,7 +33,7 @@ runs:
shell: bash
working-directory: js
env:
LANGCHAIN_TRACING_V2: "true"
LANGCHAIN_ENDPOINT: ${{ inputs.langchain-endpoint }}
LANGCHAIN_API_KEY: ${{ inputs.langchain-api-key }}
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
LANGSMITH_TRACING_V2: "true"
LANGSMITH_ENDPOINT: https://beta.api.smith.langchain.com
LANGSMITH_API_KEY: ${{ inputs.langchain-api-key-beta }}
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
35 changes: 35 additions & 0 deletions .github/actions/js-vitest-eval-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "JS Vitest Eval Runner"
description: "Run JS Vitest Eval Runner"
inputs:
node-version:
description: "Node version"
required: true
langchain-api-key-beta:
description: "Langchain"
required: true
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: "yarn"
cache-dependency-path: "js/yarn.lock"

- name: Install Yarn dependencies
run: yarn install
shell: bash
working-directory: js

- name: Run Vitest Eval Runner
run: yarn test:eval:vitest
shell: bash
working-directory: js
env:
LANGSMITH_TRACING_V2: "true"
LANGSMITH_ENDPOINT: https://beta.api.smith.langchain.com
LANGSMITH_API_KEY: ${{ inputs.langchain-api-key-beta }}
88 changes: 88 additions & 0 deletions .github/actions/poetry_setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# An action for setting up poetry install with caching.
# Using a custom action since the default action does not
# take poetry install groups into account.
# Action code from:
# https://github.com/actions/setup-python/issues/505#issuecomment-1273013236
name: poetry-install-with-caching
description: Poetry install with support for caching of dependency groups.

inputs:
python-version:
description: Python version, supporting MAJOR.MINOR only
required: true

poetry-version:
description: Poetry version
required: true

cache-key:
description: Cache key to use for manual handling of caching
required: true

runs:
using: composite
steps:
- uses: actions/setup-python@v5
name: Setup python ${{ inputs.python-version }}
id: setup-python
with:
python-version: ${{ inputs.python-version }}

- uses: actions/cache@v3
id: cache-bin-poetry
name: Cache Poetry binary - Python ${{ inputs.python-version }}
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "1"
with:
path: |
/opt/pipx/venvs/poetry
# This step caches the poetry installation, so make sure it's keyed on the poetry version as well.
key: bin-poetry-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-${{ inputs.poetry-version }}

- name: Refresh shell hashtable and fixup softlinks
if: steps.cache-bin-poetry.outputs.cache-hit == 'true'
shell: bash
env:
POETRY_VERSION: ${{ inputs.poetry-version }}
PYTHON_VERSION: ${{ inputs.python-version }}
run: |
set -eux
# Refresh the shell hashtable, to ensure correct `which` output.
hash -r
# `actions/cache@v3` doesn't always seem able to correctly unpack softlinks.
# Delete and recreate the softlinks pipx expects to have.
rm /opt/pipx/venvs/poetry/bin/python
cd /opt/pipx/venvs/poetry/bin
ln -s "$(which "python$PYTHON_VERSION")" python
chmod +x python
cd /opt/pipx_bin/
ln -s /opt/pipx/venvs/poetry/bin/poetry poetry
chmod +x poetry
# Ensure everything got set up correctly.
/opt/pipx/venvs/poetry/bin/python --version
/opt/pipx_bin/poetry --version
- name: Install poetry
if: steps.cache-bin-poetry.outputs.cache-hit != 'true'
shell: bash
env:
POETRY_VERSION: ${{ inputs.poetry-version }}
PYTHON_VERSION: ${{ inputs.python-version }}
# Install poetry using the python version installed by setup-python step.
run: pipx install "poetry==$POETRY_VERSION" --python '${{ steps.setup-python.outputs.python-path }}' --verbose

- name: Restore pip and poetry cached dependencies
uses: actions/cache@v3
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "4"
with:
path: |
~/.cache/pip
~/.cache/pypoetry/virtualenvs
~/.cache/pypoetry/cache
~/.cache/pypoetry/artifacts
./.venv
key: py-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-poetry-${{ inputs.poetry-version }}-${{ inputs.cache-key }}-${{ hashFiles('./poetry.lock') }}
33 changes: 17 additions & 16 deletions .github/actions/python-integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ inputs:
python-version:
description: "Python version"
required: true
langchain-api-key:
description: "Langchain"
langchain-api-key-beta:
description: "LangSmith Beta Key"
required: true
langchain-endpoint:
description: "LangSmith Endpoint"
langchain-api-key-prod:
description: "LangSmith Key"
required: true
openai-api-key:
description: "OpenAI API key"
Expand Down Expand Up @@ -42,34 +42,35 @@ runs:

- name: Run integration tests
env:
LANGCHAIN_TRACING_V2: "true"
LANGCHAIN_ENDPOINT: ${{ inputs.langchain-endpoint }}
LANGCHAIN_API_KEY: ${{ inputs.langchain-api-key }}
LANGSMITH_TRACING_V2: "true"
LANGSMITH_ENDPOINT: https://beta.api.smith.langchain.com
LANGSMITH_API_KEY: ${{ inputs.langchain-api-key-beta }}
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
LANGSMITH_TEST_CACHE: tests/cassettes
run: make integration_tests_fast
shell: bash
working-directory: python

- name: Run doctest
env:
LANGCHAIN_TRACING_V2: "true"
LANGCHAIN_ENDPOINT: ${{ inputs.langchain-endpoint }}
LANGCHAIN_API_KEY: ${{ inputs.langchain-api-key }}
LANGSMITH_TRACING_V2: "true"
LANGSMITH_ENDPOINT: https://api.smith.langchain.com
LANGSMITH_API_KEY: ${{ inputs.langchain-api-key-prod }}
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key }}
LANGSMITH_TEST_CACHE: tests/cassettes
run: make doctest
shell: bash
working-directory: python


- name: Run Evaluation
env:
LANGCHAIN_TRACING_V2: "true"
LANGCHAIN_ENDPOINT: ${{ inputs.langchain-endpoint }}
LANGCHAIN_API_KEY: ${{ inputs.langchain-api-key }}
LANGSMITH_TRACING: "true"
LANGSMITH_ENDPOINT: https://beta.api.smith.langchain.com
LANGSMITH_API_KEY: ${{ inputs.langchain-api-key-beta }}
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key }}
LANGSMITH_TEST_CACHE: tests/cassettes
run: make evals
shell: bash
working-directory: python

Loading

0 comments on commit be14abf

Please sign in to comment.