{"record":{"id":"223b173cfb2232ff","repo":"microsoft/semantic-kernel","slug":"unsupported-content-type-in-the-response-content","errorCode":null,"errorMessage":"Unsupported content type in the response: {content}","messagePattern":"Unsupported content type in the response: (.+?)","errorType":"exception","errorClass":"ServiceInvalidResponseError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/ai/bedrock/services/bedrock_chat_completion.py","lineNumber":257,"sourceCode":"                items.append(TextContent(text=content[\"text\"], inner_content=content))\n            elif \"image\" in content:\n                items.append(\n                    ImageContent(\n                        data=content[\"image\"][\"source\"][\"bytes\"],\n                        mime_type=content[\"image\"][\"source\"][\"format\"],\n                        inner_content=content[\"image\"],\n                    )\n                )\n            elif \"toolUse\" in content:\n                items.append(\n                    FunctionCallContent(\n                        id=content[\"toolUse\"][\"toolUseId\"],\n                        name=content[\"toolUse\"][\"name\"],\n                        arguments=content[\"toolUse\"][\"input\"],\n                    )\n                )\n            else:\n                raise ServiceInvalidResponseError(f\"Unsupported content type in the response: {content}\")\n\n        return ChatMessageContent(\n            ai_model_id=self.ai_model_id,\n            role=AuthorRole.ASSISTANT,\n            items=items,\n            inner_content=response,\n            finish_reason=finish_reason,\n            metadata={\"usage\": usage},\n        )\n\n    # region async helper methods\n\n    async def _async_converse(self, **kwargs) -> Any:\n        \"\"\"Invoke the model asynchronously.\"\"\"\n        return await run_in_executor(\n            None,\n            partial(\n                self.bedrock_runtime_client.converse,","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/ai/bedrock/services/bedrock_chat_completion.py#L239-L275","documentation":"Raised in _parse_chat_message when a content block in the Bedrock response does not match any recognized key ('text', 'image', 'toolUse'). ServiceInvalidResponseError signals that the model returned a content type the connector cannot turn into a ChatMessageContent item (TextContent, ImageContent, or FunctionCallContent).","triggerScenarios":"A Bedrock model returns a content block with a new type (e.g. 'video', 'reasoning', 'document', 'toolResult' in an assistant turn) that the connector does not yet handle, or the response structure changed.","commonSituations":"New model capability (e.g. reasoning/thinking blocks) not yet supported by the connector; provider-specific content types; version mismatch between model output and connector parsers.","solutions":["Upgrade the semantic-kernel Bedrock connector to a version supporting the new content type.","If only text/tool output is needed, retry or constrain the request to avoid triggering the new content type.","Inspect the 'content' dict to identify the unsupported key and file/track an issue."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from semantic_kernel.exceptions import ServiceInvalidResponseError\ntry:\n    result = await service.get_chat_message_contents(history=history, settings=settings)\nexcept ServiceInvalidResponseError as e:\n    if \"Unsupported content type\" in str(e):\n        # upgrade connector or retry; report the content dict for diagnosis\n        ...","preventionTips":["Upgrade the connector when adopting new model capabilities.","Constrain requests to text/tool outputs if only those are needed.","Log the unsupported content dict for fast issue triage."],"tags":["bedrock","response-parsing","content-types","version-compat","python"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}