Skip to content

Commit

Permalink
conditionally run standard tests too and make oai change to trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jun 12, 2024
1 parent fa64ad1 commit 2eca3e2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/standard-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,29 @@ on:
- cron: '0 13 * * *'

jobs:
get-changed-files:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.get_changes.outputs.changed_files }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changes
id: get_changes
run: |
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
git diff --name-only -r HEAD^1 HEAD | while read line; do printf "%s\n" "$line"; done >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
standard-tests:
runs-on: ubuntu-latest
needs: get-changed-files
strategy:
matrix:
package: [anthropic, cohere, google-genai, groq, mistralai]
if: contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') || contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-${{ matrix.package }}/')
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
Expand All @@ -34,6 +52,8 @@ jobs:
# we need separate jobs for each test.
standard-tests-openai:
runs-on: ubuntu-latest
needs: get-changed-files
if: contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') || contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-openai/')
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
Expand All @@ -52,6 +72,8 @@ jobs:

standard-tests-azure-openai:
runs-on: ubuntu-latest
needs: get-changed-files
if: contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') || contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-openai/')
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
Expand All @@ -73,6 +95,8 @@ jobs:

standard-tests-bedrock:
runs-on: ubuntu-latest
needs: get-changed-files
if: contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') || contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-community/')
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit-tests-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
unit-tests:
name: Unit Tests
needs: get-changed-files
strategy:
matrix:
os: [ubuntu-latest]
Expand Down
7 changes: 3 additions & 4 deletions libs/langchain-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,13 @@ export interface ChatOpenAICallOptions
/**
* Wrapper around OpenAI large language models that use the Chat endpoint.
*
* To use you should have the `openai` package installed, with the
* `OPENAI_API_KEY` environment variable set.
* To use you should have the `OPENAI_API_KEY` environment variable set.
*
* To use with Azure you should have the `openai` package installed, with the
* To use with Azure you should have the:
* `AZURE_OPENAI_API_KEY`,
* `AZURE_OPENAI_API_INSTANCE_NAME`,
* `AZURE_OPENAI_API_DEPLOYMENT_NAME`
* and `AZURE_OPENAI_API_VERSION` environment variable set.
* and `AZURE_OPENAI_API_VERSION` environment variables set.
* `AZURE_OPENAI_BASE_PATH` is optional and will override `AZURE_OPENAI_API_INSTANCE_NAME` if you need to use a custom endpoint.
*
* @remarks
Expand Down

0 comments on commit 2eca3e2

Please sign in to comment.