@ai-sdk/openai 2.0.23 → 2.0.25

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.
@@ -1930,7 +1930,12 @@ var OpenAITranscriptionModel = class {
1930
1930
  const formData = new FormData();
1931
1931
  const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils9.convertBase64ToUint8Array)(audio)]);
1932
1932
  formData.append("model", this.modelId);
1933
- formData.append("file", new File([blob], "audio", { type: mediaType }));
1933
+ const fileExtension = (0, import_provider_utils9.mediaTypeToExtension)(mediaType);
1934
+ formData.append(
1935
+ "file",
1936
+ new File([blob], "audio", { type: mediaType }),
1937
+ `audio.${fileExtension}`
1938
+ );
1934
1939
  if (openAIOptions) {
1935
1940
  const transcriptionModelOptions = {
1936
1941
  include: openAIOptions.include,
@@ -1947,7 +1952,13 @@ var OpenAITranscriptionModel = class {
1947
1952
  };
1948
1953
  for (const [key, value] of Object.entries(transcriptionModelOptions)) {
1949
1954
  if (value != null) {
1950
- formData.append(key, String(value));
1955
+ if (Array.isArray(value)) {
1956
+ for (const item of value) {
1957
+ formData.append(`${key}[]`, String(item));
1958
+ }
1959
+ } else {
1960
+ formData.append(key, String(value));
1961
+ }
1951
1962
  }
1952
1963
  }
1953
1964
  }