{"record":{"id":"1ded22c56a852fff","repo":"continuedev/continue","slug":"unsupported-part-type-input-audio","errorCode":null,"errorMessage":"Unsupported part type: input_audio","messagePattern":"Unsupported part type: input_audio","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Bedrock.ts","lineNumber":135,"sourceCode":"    });\n  }\n\n  private _oaiPartToBedrockPart(\n    part:\n      | OpenAI.Chat.Completions.ChatCompletionContentPart\n      | OpenAI.Chat.Completions.ChatCompletionContentPartRefusal,\n  ): ContentBlock {\n    switch (part.type) {\n      case \"refusal\":\n        return {\n          text: part.refusal,\n        };\n      case \"text\":\n        return {\n          text: part.text,\n        };\n      case \"input_audio\":\n        throw new Error(\"Unsupported part type: input_audio\");\n      case \"image_url\":\n      default:\n        const parsed = parseDataUrl(\n          (part as ChatCompletionContentPartImage).image_url.url,\n        );\n        if (!parsed) {\n          console.warn(\"Bedrock: failed to process image part - invalid URL\");\n          return { text: \"[Failed to process image]\" };\n        }\n        const { mimeType, base64Data } = parsed;\n        const format = mimeType.split(\"/\")[1]?.split(\";\")[0] || \"jpeg\";\n        if (\n          format === ImageFormat.JPEG ||\n          format === ImageFormat.PNG ||\n          format === ImageFormat.WEBP ||\n          format === ImageFormat.GIF\n        ) {\n          return {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Bedrock.ts#L117-L153","documentation":"When converting OpenAI-format chat messages to Bedrock Converse format, _oaiPartToBedrockPart maps each content part type; audio input parts ('input_audio') have no Bedrock equivalent in this adapter, so it throws rather than silently dropping the audio. The error fires per-part during message conversion, before any network call.","triggerScenarios":"Sending a chatCompletion/stream request whose message content includes a part with type: 'input_audio' (inline base64 audio or recorded audio chunks) to the Bedrock provider.","commonSituations":"Building multimodal apps against OpenAI and then pointing the same code at Bedrock, which only supports text and image_url parts here; voice-input features that attach audio parts to messages; model-agnostic frontends that pass through whatever the client sends.","solutions":["Strip or reject 'input_audio' parts before sending to Bedrock; convert audio to text via a transcription API (e.g. Whisper) and send the transcript as a text part","Route audio-capable requests to a provider that supports input_audio (e.g. OpenAI gpt-4o-audio-preview)","Validate message parts against a whitelist per provider before dispatch"],"exampleFix":"// before\nmessages: [{ role: 'user', content: [\n  { type: 'text', text: 'transcribe this' },\n  { type: 'input_audio', input_audio: { data: b64, format: 'wav' } },\n]}]\n\n// after (transcribe first, send text)\nconst text = await transcribe(b64);\nmessages: [{ role: 'user', content: [{ type: 'text', text: `transcribe this: ${text}` }] }]","handlingStrategy":"type-guard","validationCode":"const BEDROCK_PART_TYPES = new Set(['text', 'image_url']);\nconst bad = msgs.flatMap(m => m.content ?? []).filter(p => !BEDROCK_PART_TYPES.has(p.type));\nif (bad.length) throw new Error(`Unsupported part(s) for Bedrock: ${bad.map(p => p.type).join(', ')}`);","typeGuard":"const isBedrockSupportedPart = (\n  part: ChatCompletionContentPart,\n): part is ChatCompletionContentPartText | ChatCompletionContentPartImage =>\n  part.type === 'text' || part.type === 'image_url';","tryCatchPattern":"try { return await bedrock.chatCompletion(body, signal); }\ncatch (e) {\n  if (e instanceof Error && e.message === 'Unsupported part type: input_audio') {\n    return transcribeAndRetry(body); // or route to an audio-capable provider\n  }\n  throw e;\n}","preventionTips":["Filter message parts per provider before dispatch; keep a whitelist of supported part types","Transcribe audio to text client-side so all providers can consume it"],"tags":["bedrock","multimodal","audio","content-parts","unsupported-feature"],"backgroundTag":"unsupported-message-content-type","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}