@outputai/llm 0.9.3-next.c318502.0 → 0.10.1-dev.b7b2fbe.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outputai/llm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1-dev.b7b2fbe.0",
|
|
4
4
|
"description": "Framework abstraction to interact with LLM models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"gray-matter": "4.0.3",
|
|
17
17
|
"liquidjs": "10.25.7",
|
|
18
18
|
"undici": "8.5.0",
|
|
19
|
-
"@outputai/core": "0.
|
|
19
|
+
"@outputai/core": "0.10.1-dev.b7b2fbe.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@ai-sdk/amazon-bedrock": "4.0.111",
|
|
@@ -77,7 +77,15 @@ export const mapAiError = error => {
|
|
|
77
77
|
return error;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
const isApiError = APICallError.isInstance( error );
|
|
81
|
+
const isGrammarCompilationError = error.message === 'Grammar compilation timed out.';
|
|
82
|
+
|
|
83
|
+
// This error is actually transient, so instead of FatalError, return it
|
|
84
|
+
if ( isApiError && error.statusCode === 400 && isGrammarCompilationError ) {
|
|
85
|
+
return error;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if ( isApiError && !error.isRetryable ) {
|
|
81
89
|
// Non-retryable API failures are already classified by AI SDK as permanent provider failures.
|
|
82
90
|
return toFatalError( error, error.statusCode ? `HTTP ${error.statusCode}` : '' );
|
|
83
91
|
}
|
|
@@ -276,6 +276,16 @@ describe( 'mapAiError', () => {
|
|
|
276
276
|
expect( mapAiError( error ) ).toBe( error );
|
|
277
277
|
} );
|
|
278
278
|
|
|
279
|
+
it( 'preserves Anthropic grammar compilation timeouts as retryable activity failures', () => {
|
|
280
|
+
const error = makeApiCallError( {
|
|
281
|
+
message: 'Grammar compilation timed out.',
|
|
282
|
+
statusCode: 400,
|
|
283
|
+
isRetryable: false
|
|
284
|
+
} );
|
|
285
|
+
|
|
286
|
+
expect( mapAiError( error ) ).toBe( error );
|
|
287
|
+
} );
|
|
288
|
+
|
|
279
289
|
it.each( fatalAiSdkErrors )( 'maps %s to FatalError', ( _name, makeError ) => {
|
|
280
290
|
const error = makeError();
|
|
281
291
|
|