@ai-sdk/openai 2.0.20 → 2.0.21

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/dist/index.mjs CHANGED
@@ -430,7 +430,7 @@ var webSearchPreview = createProviderDefinedToolFactory2({
430
430
  action: z4.discriminatedUnion("type", [
431
431
  z4.object({
432
432
  type: z4.literal("search"),
433
- query: z4.string()
433
+ query: z4.string().nullish()
434
434
  }),
435
435
  z4.object({
436
436
  type: z4.literal("open_page"),
@@ -2174,7 +2174,7 @@ var webSearchCallItem = z13.object({
2174
2174
  action: z13.discriminatedUnion("type", [
2175
2175
  z13.object({
2176
2176
  type: z13.literal("search"),
2177
- query: z13.string()
2177
+ query: z13.string().nullish()
2178
2178
  }),
2179
2179
  z13.object({
2180
2180
  type: z13.literal("open_page"),
@@ -3520,8 +3520,12 @@ var OpenAITranscriptionModel = class {
3520
3520
  include: openAIOptions.include,
3521
3521
  language: openAIOptions.language,
3522
3522
  prompt: openAIOptions.prompt,
3523
- response_format: "verbose_json",
3524
- // always use verbose_json to get segments
3523
+ // https://platform.openai.com/docs/api-reference/audio/createTranscription#audio_createtranscription-response_format
3524
+ // prefer verbose_json to get segments for models that support it
3525
+ response_format: [
3526
+ "gpt-4o-transcribe",
3527
+ "gpt-4o-mini-transcribe"
3528
+ ].includes(this.modelId) ? "json" : "verbose_json",
3525
3529
  temperature: openAIOptions.temperature,
3526
3530
  timestamp_granularities: openAIOptions.timestampGranularities
3527
3531
  };