diff --git a/.github/workflows/standard-tests.yml b/.github/workflows/standard-tests.yml index d474706a7597..24bd8fb9b557 100644 --- a/.github/workflows/standard-tests.yml +++ b/.github/workflows/standard-tests.yml @@ -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<> $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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/unit-tests-integrations.yml b/.github/workflows/unit-tests-integrations.yml index 03aed75005a6..06af6388b01e 100644 --- a/.github/workflows/unit-tests-integrations.yml +++ b/.github/workflows/unit-tests-integrations.yml @@ -43,6 +43,7 @@ jobs: unit-tests: name: Unit Tests + needs: get-changed-files strategy: matrix: os: [ubuntu-latest] diff --git a/libs/langchain-openai/src/chat_models.ts b/libs/langchain-openai/src/chat_models.ts index a6477039114c..243518c41c2d 100644 --- a/libs/langchain-openai/src/chat_models.ts +++ b/libs/langchain-openai/src/chat_models.ts @@ -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