@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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.86
4
+
5
+ ### Patch Changes
6
+
7
+ - d3bcad9: feat(provider): report decision refusals as refusal answers
8
+ - Updated dependencies [d3bcad9]
9
+ - @ai-sdk/provider@4.0.24
10
+ - @ai-sdk/provider-utils@5.0.56
11
+
3
12
  ## 4.0.85
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -163,10 +163,13 @@ var DecisionOpenAIModel = class DecisionOpenAIModel {
163
163
  successfulResponseHandler: createJsonResponseHandler(responseSchema)
164
164
  });
165
165
  const answers = Object.fromEntries(response.answers.map((answer) => {
166
- if (answer.type === "refusal") throw new InvalidResponseDataError({
167
- data: rawValue,
168
- message: answer.name === null ? "OpenAI Decisions refused an unnamed question." : `OpenAI Decisions refused question ${JSON.stringify(answer.name)}.`
169
- });
166
+ if (answer.type === "refusal") {
167
+ if (answer.name === null) throw new InvalidResponseDataError({
168
+ data: rawValue,
169
+ message: "OpenAI Decisions refused an unnamed question."
170
+ });
171
+ return [answer.name, { type: "refusal" }];
172
+ }
170
173
  if (answer.type === "predicate") return [answer.name, {
171
174
  type: "boolean",
172
175
  probability: answer.probability
@@ -10035,7 +10038,7 @@ var OpenAISkills = class {
10035
10038
  };
10036
10039
  //#endregion
10037
10040
  //#region src/version.ts
10038
- const VERSION = "4.0.85";
10041
+ const VERSION = "4.0.86";
10039
10042
  //#endregion
10040
10043
  //#region src/openai-provider.ts
10041
10044
  /**