@ai-sdk/openai 4.0.85 → 4.0.86
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 +9 -0
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/openai-decision-model.ts +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.86",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ai-sdk/provider": "4.0.
|
|
39
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
38
|
+
"@ai-sdk/provider": "4.0.24",
|
|
39
|
+
"@ai-sdk/provider-utils": "5.0.56"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ai-sdk/test-server": "2.0.4",
|
|
@@ -194,13 +194,13 @@ export class DecisionOpenAIModel implements DecisionModelV4 {
|
|
|
194
194
|
const answers = Object.fromEntries(
|
|
195
195
|
response.answers.map((answer): [string, DecisionModelV4Answer] => {
|
|
196
196
|
if (answer.type === 'refusal') {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
197
|
+
if (answer.name === null) {
|
|
198
|
+
throw new InvalidResponseDataError({
|
|
199
|
+
data: rawValue,
|
|
200
|
+
message: 'OpenAI Decisions refused an unnamed question.',
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
return [answer.name, { type: 'refusal' }];
|
|
204
204
|
}
|
|
205
205
|
if (answer.type === 'predicate') {
|
|
206
206
|
return [
|