@ai-sdk/openai 2.0.7 → 2.0.9

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,18 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 8f8a521: fix(providers): use convertToBase64 for Uint8Array image parts to produce valid data URLs; keep mediaType normalization and URL passthrough
8
+
9
+ ## 2.0.8
10
+
11
+ ### Patch Changes
12
+
13
+ - 57fb959: feat(openai): add verbosity parameter support for chat api
14
+ - 2a3fbe6: allow `minimal` in `reasoningEffort` for openai chat
15
+
3
16
  ## 2.0.7
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -273,7 +273,7 @@ var openaiProviderOptions = import_v4.z.object({
273
273
  /**
274
274
  * Reasoning effort for reasoning models. Defaults to `medium`.
275
275
  */
276
- reasoningEffort: import_v4.z.enum(["low", "medium", "high"]).optional(),
276
+ reasoningEffort: import_v4.z.enum(["minimal", "low", "medium", "high"]).optional(),
277
277
  /**
278
278
  * Maximum number of completion tokens to generate. Useful for reasoning models.
279
279
  */
@@ -310,7 +310,12 @@ var openaiProviderOptions = import_v4.z.object({
310
310
  *
311
311
  * @default false
312
312
  */
313
- strictJsonSchema: import_v4.z.boolean().optional()
313
+ strictJsonSchema: import_v4.z.boolean().optional(),
314
+ /**
315
+ * Controls the verbosity of the model's responses.
316
+ * Lower values will result in more concise responses, while higher values will result in more verbose responses.
317
+ */
318
+ textVerbosity: import_v4.z.enum(["low", "medium", "high"]).optional()
314
319
  });
315
320
 
316
321
  // src/openai-error.ts
@@ -591,6 +596,7 @@ var OpenAIChatLanguageModel = class {
591
596
  } : { type: "json_object" } : void 0,
592
597
  stop: stopSequences,
593
598
  seed,
599
+ verbosity: openaiOptions.textVerbosity,
594
600
  // openai specific settings:
595
601
  // TODO remove in next major version; we auto-map maxOutputTokens now
596
602
  max_completion_tokens: openaiOptions.maxCompletionTokens,
@@ -1996,7 +2002,7 @@ async function convertToOpenAIResponsesMessages({
1996
2002
  return {
1997
2003
  type: "input_image",
1998
2004
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && part.data.startsWith("file-") ? { file_id: part.data } : {
1999
- image_url: `data:${mediaType};base64,${part.data}`
2005
+ image_url: `data:${mediaType};base64,${(0, import_provider_utils11.convertToBase64)(part.data)}`
2000
2006
  },
2001
2007
  detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b2.imageDetail
2002
2008
  };