{"record":{"id":"d2e463f3f31bce01","repo":"microsoft/semantic-kernel","slug":"the-autogenconversableagent-does-not-support-strea","errorCode":null,"errorMessage":"The AutoGenConversableAgent does not support streaming.","messagePattern":"The AutoGenConversableAgent does not support streaming\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/autogen/autogen_conversable_agent.py","lineNumber":266,"sourceCode":"                messages=[message.to_dict() async for message in thread.get_messages()],\n            )\n\n            logger.info(\"Called AutoGenConversableAgent.a_generate_reply.\")\n\n            yield await self._create_reply_content(reply, thread)\n\n    @override\n    def invoke_stream(\n        self,\n        messages: str | ChatMessageContent | list[str | ChatMessageContent] | None = None,\n        *,\n        thread: AgentThread | None = None,\n        kernel: \"Kernel | None\" = None,\n        arguments: KernelArguments | None = None,\n        **kwargs: Any,\n    ) -> AsyncIterable[AgentResponseItem[\"StreamingChatMessageContent\"]]:\n        \"\"\"Invoke the agent with a stream of messages.\"\"\"\n        raise NotImplementedError(\"The AutoGenConversableAgent does not support streaming.\")\n\n    @staticmethod\n    def _to_chat_message_content(message: dict[str, Any]) -> ChatMessageContent:\n        \"\"\"Translate an AutoGen message to a Semantic Kernel ChatMessageContent.\"\"\"\n        items: list[TextContent | FunctionCallContent | FunctionResultContent] = []\n        role = AuthorRole(message.get(\"role\"))\n        name: str = message.get(\"name\", \"\")\n\n        content = message.get(\"content\")\n        if content is not None:\n            text = TextContent(text=content)\n            items.append(text)\n\n        if role == AuthorRole.ASSISTANT:\n            tool_calls = message.get(\"tool_calls\")\n            if tool_calls is not None:\n                for tool_call in tool_calls:\n                    items.append(","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/autogen/autogen_conversable_agent.py#L248-L284","documentation":"Raised unconditionally by AutoGenConversableAgent.invoke_stream, which overrides the streaming entry point to signal that AutoGen 0.2 ConversableAgent does not support streaming responses. Any caller that routes through invoke_stream (e.g. generic streaming code paths) hits this immediately.","triggerScenarios":"Calling `async for chunk in agent.invoke_stream(...)` on an AutoGenConversableAgent; a framework/orchestrator that always uses the streaming API regardless of agent type.","commonSituations":"Generic agent runner that picks invoke_stream for all agents; migrating from a streaming-capable agent to AutoGenConversableAgent without switching to non-streaming invoke.","solutions":["Use the non-streaming `agent.invoke(...)` (or get_response) for AutoGenConversableAgent.","Branch in your runner: check `isinstance(agent, AutoGenConversableAgent)` and call invoke instead of invoke_stream.","Switch to an agent type that supports streaming (e.g. ChatCompletionAgent) if streaming is mandatory."],"exampleFix":"# before\nasync for chunk in agent.invoke_stream(messages='hi', thread=thread):\n    ...\n\n# after\nasync for response in agent.invoke(messages='hi', thread=thread):\n    ...","handlingStrategy":"type-guard","validationCode":"from semantic_kernel.agents.autogen import AutoGenConversableAgent\nstreaming = not isinstance(agent, AutoGenConversableAgent)","typeGuard":"from semantic_kernel.agents.autogen import AutoGenConversableAgent\ndef supports_streaming(agent) -> bool:\n    return not isinstance(agent, AutoGenConversableAgent)","tryCatchPattern":"from semantic_kernel.agents.autogen import AutoGenConversableAgent\nif isinstance(agent, AutoGenConversableAgent):\n    responses = [r async for r in agent.invoke(messages=msg, thread=thread)]\nelse:\n    async for chunk in agent.invoke_stream(messages=msg, thread=thread):\n        ...","preventionTips":["Branch your runner on agent type to choose invoke vs invoke_stream.","Do not assume all agents support streaming."],"tags":["autogen","streaming","not-implemented","semantic-kernel"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}