Skip to content

Commit afc1500

Browse files
authored
ai-sdk rewrite (#1021)
1 parent 7a123d3 commit afc1500

77 files changed

Lines changed: 22816 additions & 2926 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

internal/golden/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ These test files validate the Braintrust SDK's integration with different AI pro
77
- `anthropic.ts` - Tests for Anthropic/Claude integration
88
- `openai.ts` - Tests for OpenAI integration
99
- `google_genai.py` - Tests for Google Generative AI integration
10+
- `ai-sdk.ts` - Tests for AI SDK (Vercel) integration across multiple versions
1011

1112
Each test suite validates:
1213

@@ -19,6 +20,47 @@ Each test suite validates:
1920
- Tool use and function calling
2021
- Mixed content types
2122

23+
## AI SDK Version Testing
24+
25+
The `ai-sdk.ts` test file can be run against multiple versions of the Vercel AI SDK (v3, v4, v5, and v6 beta) to ensure compatibility across versions. Each version has its own directory with compatible provider packages:
26+
27+
- `ai-sdk-v3/` - AI SDK v3.x with compatible providers
28+
- `ai-sdk-v4/` - AI SDK v4.x with compatible providers
29+
- `ai-sdk-v5/` - AI SDK v5.x with compatible providers
30+
- `ai-sdk-v6/` - AI SDK v6.x beta with compatible providers
31+
32+
### Running AI SDK Version Tests
33+
34+
```bash
35+
# Install dependencies for a specific version
36+
cd ai-sdk-v5
37+
pnpm install --ignore-workspace
38+
39+
# Run the tests
40+
npx tsx ai-sdk.ts
41+
42+
# Or test another version
43+
cd ../ai-sdk-v3
44+
pnpm install --ignore-workspace
45+
npx tsx ai-sdk.ts
46+
```
47+
48+
### Updating Test Files
49+
50+
When you update the main `ai-sdk.ts` file, sync it to all version directories:
51+
52+
```bash
53+
./sync-test-file.sh
54+
```
55+
56+
Or manually:
57+
58+
```bash
59+
for dir in ai-sdk-v{3,4,5,6}; do
60+
cp ai-sdk.ts $dir/ai-sdk.ts
61+
done
62+
```
63+
2264
## Running Tests
2365

2466
### TypeScript Tests

0 commit comments

Comments
 (0)