@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.
Files changed (50) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/index.d.mts +7 -0
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +20 -9
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +21 -9
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +9 -5
  9. package/src/anthropic-provider.ts +32 -7
  10. package/src/__fixtures__/anthropic-code-execution-20250825.1.chunks.txt +0 -248
  11. package/src/__fixtures__/anthropic-code-execution-20250825.1.json +0 -70
  12. package/src/__fixtures__/anthropic-code-execution-20250825.2.chunks.txt +0 -984
  13. package/src/__fixtures__/anthropic-code-execution-20250825.2.json +0 -111
  14. package/src/__fixtures__/anthropic-code-execution-20250825.pptx-skill.chunks.txt +0 -691
  15. package/src/__fixtures__/anthropic-code-execution-20250825.pptx-skill.json +0 -1801
  16. package/src/__fixtures__/anthropic-json-other-tool.1.chunks.txt +0 -13
  17. package/src/__fixtures__/anthropic-json-other-tool.1.json +0 -26
  18. package/src/__fixtures__/anthropic-json-output-format.1.chunks.txt +0 -120
  19. package/src/__fixtures__/anthropic-json-output-format.1.json +0 -25
  20. package/src/__fixtures__/anthropic-json-tool.1.chunks.txt +0 -9
  21. package/src/__fixtures__/anthropic-json-tool.1.json +0 -37
  22. package/src/__fixtures__/anthropic-json-tool.2.chunks.txt +0 -14
  23. package/src/__fixtures__/anthropic-mcp.1.chunks.txt +0 -17
  24. package/src/__fixtures__/anthropic-mcp.1.json +0 -39
  25. package/src/__fixtures__/anthropic-memory-20250818.1.json +0 -28
  26. package/src/__fixtures__/anthropic-message-delta-input-tokens.chunks.txt +0 -8
  27. package/src/__fixtures__/anthropic-programmatic-tool-calling.1.chunks.txt +0 -278
  28. package/src/__fixtures__/anthropic-programmatic-tool-calling.1.json +0 -106
  29. package/src/__fixtures__/anthropic-tool-no-args.chunks.txt +0 -13
  30. package/src/__fixtures__/anthropic-tool-no-args.json +0 -31
  31. package/src/__fixtures__/anthropic-tool-search-bm25.1.chunks.txt +0 -47
  32. package/src/__fixtures__/anthropic-tool-search-bm25.1.json +0 -67
  33. package/src/__fixtures__/anthropic-tool-search-deferred-bm25.2.json +0 -65
  34. package/src/__fixtures__/anthropic-tool-search-deferred-bm25.chunks.txt +0 -115
  35. package/src/__fixtures__/anthropic-tool-search-deferred-regex.2.json +0 -69
  36. package/src/__fixtures__/anthropic-tool-search-deferred-regex.chunks.txt +0 -119
  37. package/src/__fixtures__/anthropic-tool-search-regex.1.chunks.txt +0 -51
  38. package/src/__fixtures__/anthropic-tool-search-regex.1.json +0 -65
  39. package/src/__fixtures__/anthropic-web-fetch-tool.1.chunks.txt +0 -64
  40. package/src/__fixtures__/anthropic-web-fetch-tool.1.json +0 -54
  41. package/src/__fixtures__/anthropic-web-fetch-tool.2.json +0 -56
  42. package/src/__fixtures__/anthropic-web-fetch-tool.error.json +0 -46
  43. package/src/__fixtures__/anthropic-web-search-tool.1.chunks.txt +0 -120
  44. package/src/__fixtures__/anthropic-web-search-tool.1.json +0 -181
  45. package/src/__snapshots__/anthropic-messages-language-model.test.ts.snap +0 -16719
  46. package/src/anthropic-error.test.ts +0 -42
  47. package/src/anthropic-messages-language-model.test.ts +0 -7368
  48. package/src/anthropic-prepare-tools.test.ts +0 -1219
  49. package/src/anthropic-provider.test.ts +0 -162
  50. 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
- });