File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @ai-sdk/provider-utils ' : patch
3
+ ---
4
+
5
+ fix (provider-utils): rename to isParsableJson
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
11
11
createEventSourceResponseHandler ,
12
12
createJsonResponseHandler ,
13
13
generateId ,
14
- isParseableJson ,
14
+ isParsableJson ,
15
15
postJsonToApi ,
16
16
} from '@ai-sdk/provider-utils' ;
17
17
import { z } from 'zod' ;
@@ -338,7 +338,7 @@ export class OpenAIChatLanguageModel implements LanguageModelV1 {
338
338
if (
339
339
toolCall . function ?. name == null ||
340
340
toolCall . function ?. arguments == null ||
341
- ! isParseableJson ( toolCall . function . arguments )
341
+ ! isParsableJson ( toolCall . function . arguments )
342
342
) {
343
343
continue ;
344
344
}
Original file line number Diff line number Diff line change @@ -108,11 +108,16 @@ export function safeParseJSON<T>({
108
108
}
109
109
}
110
110
111
- export function isParseableJson ( input : string ) : boolean {
111
+ export function isParsableJson ( input : string ) : boolean {
112
112
try {
113
113
SecureJSON . parse ( input ) ;
114
114
return true ;
115
115
} catch {
116
116
return false ;
117
117
}
118
118
}
119
+
120
+ /**
121
+ @deprecated Use `isParsableJson` instead.
122
+ */
123
+ export const isParseableJson = isParsableJson ;
You can’t perform that action at this time.
0 commit comments