@codeproxy/core 0.1.13 → 0.1.14

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.cjs CHANGED
@@ -1220,15 +1220,21 @@ function processInputItem(item, messages, options) {
1220
1220
  contentBlocks.push({ type: "image_url", image_url: { url } });
1221
1221
  }
1222
1222
  } else if (part.type === "input_file" || part.type === "file") {
1223
- const partFile = part;
1224
- const fileData = String(partFile.file_data ?? partFile.data ?? "");
1223
+ const fileData = String(contentPart.file_data ?? contentPart.data ?? "");
1225
1224
  const mimeType = String(
1226
- partFile.mime_type ?? partFile.media_type ?? "application/pdf"
1225
+ contentPart.mime_type ?? contentPart.media_type ?? "application/pdf"
1227
1226
  );
1228
1227
  if (fileData) {
1229
1228
  const url = fileData.startsWith("data:") ? fileData : `data:${mimeType};base64,${fileData}`;
1230
1229
  contentBlocks.push({ type: "image_url", image_url: { url } });
1231
1230
  }
1231
+ } else if (contentPart.type === "input_audio") {
1232
+ const ia = contentPart.input_audio;
1233
+ const data = String(ia?.data ?? contentPart.data ?? "");
1234
+ const format = String(ia?.format ?? contentPart.format ?? "mp3");
1235
+ if (data) {
1236
+ contentBlocks.push({ type: "input_audio", input_audio: { data, format } });
1237
+ }
1232
1238
  }
1233
1239
  }
1234
1240
  }