@ai-sdk/anthropic 3.0.21 → 3.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -5
- package/src/anthropic-provider.ts +32 -7
- package/src/__fixtures__/anthropic-code-execution-20250825.1.chunks.txt +0 -248
- package/src/__fixtures__/anthropic-code-execution-20250825.1.json +0 -70
- package/src/__fixtures__/anthropic-code-execution-20250825.2.chunks.txt +0 -984
- package/src/__fixtures__/anthropic-code-execution-20250825.2.json +0 -111
- package/src/__fixtures__/anthropic-code-execution-20250825.pptx-skill.chunks.txt +0 -691
- package/src/__fixtures__/anthropic-code-execution-20250825.pptx-skill.json +0 -1801
- package/src/__fixtures__/anthropic-json-other-tool.1.chunks.txt +0 -13
- package/src/__fixtures__/anthropic-json-other-tool.1.json +0 -26
- package/src/__fixtures__/anthropic-json-output-format.1.chunks.txt +0 -120
- package/src/__fixtures__/anthropic-json-output-format.1.json +0 -25
- package/src/__fixtures__/anthropic-json-tool.1.chunks.txt +0 -9
- package/src/__fixtures__/anthropic-json-tool.1.json +0 -37
- package/src/__fixtures__/anthropic-json-tool.2.chunks.txt +0 -14
- package/src/__fixtures__/anthropic-mcp.1.chunks.txt +0 -17
- package/src/__fixtures__/anthropic-mcp.1.json +0 -39
- package/src/__fixtures__/anthropic-memory-20250818.1.json +0 -28
- package/src/__fixtures__/anthropic-message-delta-input-tokens.chunks.txt +0 -8
- package/src/__fixtures__/anthropic-programmatic-tool-calling.1.chunks.txt +0 -278
- package/src/__fixtures__/anthropic-programmatic-tool-calling.1.json +0 -106
- package/src/__fixtures__/anthropic-tool-no-args.chunks.txt +0 -13
- package/src/__fixtures__/anthropic-tool-no-args.json +0 -31
- package/src/__fixtures__/anthropic-tool-search-bm25.1.chunks.txt +0 -47
- package/src/__fixtures__/anthropic-tool-search-bm25.1.json +0 -67
- package/src/__fixtures__/anthropic-tool-search-deferred-bm25.2.json +0 -65
- package/src/__fixtures__/anthropic-tool-search-deferred-bm25.chunks.txt +0 -115
- package/src/__fixtures__/anthropic-tool-search-deferred-regex.2.json +0 -69
- package/src/__fixtures__/anthropic-tool-search-deferred-regex.chunks.txt +0 -119
- package/src/__fixtures__/anthropic-tool-search-regex.1.chunks.txt +0 -51
- package/src/__fixtures__/anthropic-tool-search-regex.1.json +0 -65
- package/src/__fixtures__/anthropic-web-fetch-tool.1.chunks.txt +0 -64
- package/src/__fixtures__/anthropic-web-fetch-tool.1.json +0 -54
- package/src/__fixtures__/anthropic-web-fetch-tool.2.json +0 -56
- package/src/__fixtures__/anthropic-web-fetch-tool.error.json +0 -46
- package/src/__fixtures__/anthropic-web-search-tool.1.chunks.txt +0 -120
- package/src/__fixtures__/anthropic-web-search-tool.1.json +0 -181
- package/src/__snapshots__/anthropic-messages-language-model.test.ts.snap +0 -16719
- package/src/anthropic-error.test.ts +0 -42
- package/src/anthropic-messages-language-model.test.ts +0 -7368
- package/src/anthropic-prepare-tools.test.ts +0 -1219
- package/src/anthropic-provider.test.ts +0 -162
- package/src/convert-to-anthropic-messages-prompt.test.ts +0 -2902
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { safeValidateTypes } from '@ai-sdk/provider-utils';
|
|
2
|
-
import { anthropicErrorDataSchema } from './anthropic-error';
|
|
3
|
-
import { describe, it, expect } from 'vitest';
|
|
4
|
-
|
|
5
|
-
describe('anthropicError', () => {
|
|
6
|
-
describe('anthropicErrorDataSchema', () => {
|
|
7
|
-
it('should parse overloaded error', async () => {
|
|
8
|
-
const result = await safeValidateTypes({
|
|
9
|
-
value: {
|
|
10
|
-
type: 'error',
|
|
11
|
-
error: {
|
|
12
|
-
details: null,
|
|
13
|
-
type: 'overloaded_error',
|
|
14
|
-
message: 'Overloaded',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
schema: anthropicErrorDataSchema,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
expect(result).toMatchInlineSnapshot(`
|
|
21
|
-
{
|
|
22
|
-
"rawValue": {
|
|
23
|
-
"error": {
|
|
24
|
-
"details": null,
|
|
25
|
-
"message": "Overloaded",
|
|
26
|
-
"type": "overloaded_error",
|
|
27
|
-
},
|
|
28
|
-
"type": "error",
|
|
29
|
-
},
|
|
30
|
-
"success": true,
|
|
31
|
-
"value": {
|
|
32
|
-
"error": {
|
|
33
|
-
"message": "Overloaded",
|
|
34
|
-
"type": "overloaded_error",
|
|
35
|
-
},
|
|
36
|
-
"type": "error",
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
`);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
});
|