forked from langchain-ai/langchainjs
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (109 loc) · 5.04 KB
/
standard-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Standard Tests (Integration)
on:
workflow_dispatch:
schedule:
- cron: '0 13 * * *'
jobs:
standard-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: [anthropic, cohere, google-genai, groq, mistralai, aws, google-vertexai-web]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Run integration tests for ${{ matrix.package }}
run: yarn turbo test:integration --filter=@langchain/${{ matrix.package }}
env:
ANTHROPIC_API_KEY: ${{ matrix.package == 'anthropic' && secrets.ANTHROPIC_API_KEY || '' }}
COHERE_API_KEY: ${{ matrix.package == 'cohere' && secrets.COHERE_API_KEY || '' }}
GOOGLE_API_KEY: ${{ matrix.package == 'google-genai' && secrets.GOOGLE_API_KEY || '' }}
GROQ_API_KEY: ${{ matrix.package == 'groq' && secrets.GROQ_API_KEY || '' }}
MISTRAL_API_KEY: ${{ matrix.package == 'mistralai' && secrets.MISTRAL_API_KEY || '' }}
BEDROCK_AWS_ACCESS_KEY_ID: ${{ matrix.package == 'aws' && secrets.BEDROCK_AWS_ACCESS_KEY_ID || '' }}
BEDROCK_AWS_SECRET_ACCESS_KEY: ${{ matrix.package == 'aws' && secrets.BEDROCK_AWS_SECRET_ACCESS_KEY || '' }}
BEDROCK_AWS_REGION: ${{ matrix.package == 'aws' && 'us-east-1' || '' }}
GOOGLE_VERTEX_AI_WEB_CREDENTIALS: ${{ matrix.package == 'google-vertexai-web' && secrets.GOOGLE_VERTEX_AI_WEB_CREDENTIALS || '' }}
# The `@langchain/openai` package contains standard tests for ChatOpenAI and AzureChatOpenAI
# We want to run these separately, so we need to pass the exact path for each test, which means
# we need separate jobs for each test.
standard-tests-openai:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/openai`
run: yarn build --filter=@langchain/openai
- name: Run integration tests for ChatOpenAI
run: yarn workspace @langchain/openai test:single src/tests/chat_models_structured_output.int.test.ts src/tests/chat_models-extended.int.test.ts src/tests/chat_models-vision.int.test.ts src/tests/chat_models.int.test.ts src/tests/chat_models.standard.int.test.ts
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
standard-tests-azure-openai:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/openai`
run: yarn build --filter=@langchain/openai
- name: Run integration tests for `@langchain/openai` AzureChatOpenAI
run: yarn workspace @langchain/openai test:single src/tests/azure/chat_models.standard.int.test.ts src/tests/azure/chat_models.int.test.ts
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_API_DEPLOYMENT_NAME: "chat"
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_BASE_PATH: ${{ secrets.AZURE_OPENAI_BASE_PATH }}
standard-tests-bedrock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/community`
run: yarn build --filter=@langchain/community
- name: Run standard tests (integration) for `@langchain/community` BedrockChat
run: yarn workspace @langchain/community test:single src/chat_models/tests/chatbedrock.standard.int.test.ts
env:
BEDROCK_AWS_REGION: "us-east-1"
BEDROCK_AWS_SECRET_ACCESS_KEY: ${{ secrets.BEDROCK_AWS_SECRET_ACCESS_KEY }}
BEDROCK_AWS_ACCESS_KEY_ID: ${{ secrets.BEDROCK_AWS_ACCESS_KEY_ID }}
standard-tests-fireworks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: Build `@langchain/community`
run: yarn build --filter=@langchain/community
- name: Run standard tests (integration) for `@langchain/community` ChatFireworks
run: yarn workspace @langchain/community test:single src/chat_models/tests/chatfireworks.standard.int.test.ts
env:
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}