ai-retry 1.0.0-beta.3 → 1.0.1

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/README.md CHANGED
@@ -19,16 +19,20 @@ It supports two types of retries:
19
19
 
20
20
  ### Installation
21
21
 
22
- Install the beta version of `ai-retry` to support AI SDK v6.
22
+ This library supports both AI SDK v5 and v6. The main branch reflects the latest stable version for AI SDK v6. See the [v0 branch](https://github.com/zirkelc/ai-retry/tree/v0) for documentation.
23
23
 
24
- > [!NOTE]
25
- > AI SDK v6 is still in beta, so break changes are expected.
26
-
27
- > [!NOTE]
28
- > AI SDK v6 support is available in the [v6 branch](https://github.com/zirkelc/ai-retry/tree/v6).
24
+ > [!WARNING]
25
+ > Version compatibility:
26
+ >
27
+ > - Use `ai-retry` version 0.x for AI SDK v5.
28
+ > - Use `ai-retry` version 1.x for AI SDK v6.
29
29
 
30
30
  ```bash
31
- npm install ai-retry@beta
31
+ # AI SDK v5
32
+ npm install ai-retry@0
33
+
34
+ # AI SDK v6
35
+ npm install ai-retry@1
32
36
  ```
33
37
 
34
38
  ### Usage
@@ -206,7 +210,7 @@ const resultBasedRetry: Retryable = (context) => {
206
210
  if (isResultAttempt(context.current)) {
207
211
  const { result } = context.current;
208
212
  // The request succeeded, but the response indicates a problem
209
- if (result.finishReason === 'content-filter') {
213
+ if (result.finishReason.unified === 'content-filter') {
210
214
  console.log('Content was filtered, trying different model');
211
215
  return { model: openai('gpt-4') };
212
216
  }
package/dist/index.d.mts CHANGED
@@ -35,7 +35,7 @@ declare function isResultAttempt(attempt: RetryAttempt<any>): attempt is RetryRe
35
35
  * These types are also emitted by `onChunk` callbacks.
36
36
  * @see https://github.com/vercel/ai/blob/1fe4bd4144bff927f5319d9d206e782a73979ccb/packages/ai/src/generate-text/stream-text.ts#L686-L697
37
37
  */
38
- declare const isStreamContentPart: (part: LanguageModelStreamPart) => part is _ai_sdk_provider0.LanguageModelV3Source | _ai_sdk_provider0.LanguageModelV3ToolCall | _ai_sdk_provider0.LanguageModelV3ToolResult | {
38
+ declare const isStreamContentPart: (part: LanguageModelStreamPart) => part is {
39
39
  type: "text-delta";
40
40
  id: string;
41
41
  providerMetadata?: _ai_sdk_provider0.SharedV3ProviderMetadata;
@@ -58,7 +58,7 @@ declare const isStreamContentPart: (part: LanguageModelStreamPart) => part is _a
58
58
  id: string;
59
59
  delta: string;
60
60
  providerMetadata?: _ai_sdk_provider0.SharedV3ProviderMetadata;
61
- } | {
61
+ } | _ai_sdk_provider0.LanguageModelV3ToolCall | _ai_sdk_provider0.LanguageModelV3ToolResult | _ai_sdk_provider0.LanguageModelV3Source | {
62
62
  type: "raw";
63
63
  rawValue: unknown;
64
64
  };
@@ -19,7 +19,7 @@ function contentFilterTriggered(model, options) {
19
19
  }
20
20
  if (isResultAttempt(current)) {
21
21
  const { result } = current;
22
- if (result.finishReason === "content-filter") return {
22
+ if (result.finishReason.unified === "content-filter") return {
23
23
  model,
24
24
  maxAttempts: 1,
25
25
  ...options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-retry",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.1",
4
4
  "description": "AI SDK Retry",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -33,30 +33,30 @@
33
33
  "ai": "6.x"
34
34
  },
35
35
  "devDependencies": {
36
- "@ai-sdk/anthropic": "3.0.0-beta.80",
37
- "@ai-sdk/azure": "3.0.0-beta.91",
38
- "@ai-sdk/gateway": "2.0.18",
39
- "@ai-sdk/groq": "3.0.0-beta.48",
40
- "@ai-sdk/openai": "3.0.0-beta.89",
41
- "@ai-sdk/test-server": "1.0.0-beta.1",
36
+ "@ai-sdk/anthropic": "3.0.0",
37
+ "@ai-sdk/azure": "3.0.0",
38
+ "@ai-sdk/gateway": "2.0.23",
39
+ "@ai-sdk/groq": "3.0.0",
40
+ "@ai-sdk/openai": "3.0.0",
41
+ "@ai-sdk/test-server": "1.0.0",
42
42
  "@arethetypeswrong/cli": "^0.18.2",
43
- "@biomejs/biome": "^2.3.8",
43
+ "@biomejs/biome": "^2.3.10",
44
44
  "@total-typescript/tsconfig": "^1.0.4",
45
- "@types/node": "^24.10.2",
46
- "ai": "6.0.0-beta.139",
45
+ "@types/node": "^25.0.3",
46
+ "ai": "6.0.0",
47
47
  "husky": "^9.1.7",
48
48
  "msw": "^2.12.4",
49
49
  "pkg-pr-new": "^0.0.62",
50
50
  "publint": "^0.3.16",
51
- "tsdown": "^0.17.2",
51
+ "tsdown": "^0.18.2",
52
52
  "tsx": "^4.21.0",
53
53
  "typescript": "^5.9.3",
54
- "vitest": "^4.0.15",
55
- "zod": "^4.1.13"
54
+ "vitest": "^4.0.16",
55
+ "zod": "^4.2.1"
56
56
  },
57
57
  "dependencies": {
58
- "@ai-sdk/provider": "3.0.0-beta.26",
59
- "@ai-sdk/provider-utils": "4.0.0-beta.45"
58
+ "@ai-sdk/provider": "3.0.0",
59
+ "@ai-sdk/provider-utils": "4.0.0"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsdown",