{"record":{"id":"0f6448f9d3b3f8f8","repo":"microsoft/semantic-kernel","slug":"the-inner-get-streaming-chat-message-contents-met","errorCode":null,"errorMessage":"The _inner_get_streaming_chat_message_contents method is not implemented.","messagePattern":"The _inner_get_streaming_chat_message_contents method is not implemented\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/ai/chat_completion_client_base.py","lineNumber":76,"sourceCode":"        raise NotImplementedError(\"The _inner_get_chat_message_contents method is not implemented.\")\n\n    async def _inner_get_streaming_chat_message_contents(\n        self,\n        chat_history: \"ChatHistory\",\n        settings: \"PromptExecutionSettings\",\n        function_invoke_attempt: int = 0,\n    ) -> AsyncGenerator[list[\"StreamingChatMessageContent\"], Any]:\n        \"\"\"Send a streaming chat request to the AI service.\n\n        Args:\n            chat_history: The chat history to send.\n            settings: The settings for the request.\n            function_invoke_attempt: The current attempt count for automatically invoking functions.\n\n        Yields:\n            streaming_chat_message_contents: The streaming chat message contents.\n        \"\"\"\n        raise NotImplementedError(\"The _inner_get_streaming_chat_message_contents method is not implemented.\")\n        # Below is needed for mypy: https://mypy.readthedocs.io/en/stable/more_types.html#asynchronous-iterators\n        if False:\n            yield\n\n    # endregion\n\n    # region Public methods\n\n    async def get_chat_message_contents(\n        self,\n        chat_history: \"ChatHistory\",\n        settings: \"PromptExecutionSettings\",\n        **kwargs: Any,\n    ) -> list[\"ChatMessageContent\"]:\n        \"\"\"Create chat message contents, in the number specified by the settings.\n\n        Args:\n            chat_history (ChatHistory): A list of chats in a chat_history object, that can be","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/ai/chat_completion_client_base.py#L58-L94","documentation":"Raised by the base ChatCompletionClientBase._inner_get_streaming_chat_message_contents stub. It is the default async-generator implementation meant to be overridden by each concrete connector; calling it means the subclass never provided a streaming chat handler.","triggerScenarios":"A chat completion service subclass that does not override _inner_get_streaming_chat_message_contents, then get_streaming_chat_message_contents/get_streaming_chat_message_content is iterated. The 'if False: yield' block exists only to satisfy mypy's async-iterator requirement.","commonSituations":"A custom connector that implemented only the non-streaming method; a service that only supports non-streaming but the caller used the streaming API; a mock subclass missing the streaming override.","solutions":["Implement 'async def _inner_get_streaming_chat_message_contents(self, chat_history, settings, function_invoke_attempt=0)' as an async generator in your subclass.","If the provider is non-streaming only, call get_chat_message_contents instead.","Use a shipped connector class that already implements streaming."],"exampleFix":"# before\nclass MyService(ChatCompletionClientBase): ...\nasync for m in my_service.get_streaming_chat_message_contents(history, settings): ...\n# after\nclass MyService(ChatCompletionClientBase):\n    async def _inner_get_streaming_chat_message_contents(self, chat_history, settings, function_invoke_attempt=0):\n        yield [StreamingChatMessageContent(role=AuthorRole.ASSISTANT, choice_index=0, items=[StreamingTextContent(choice_index=0, text=\"hi\")])]","handlingStrategy":"type-guard","validationCode":"def service_implements_streaming(service) -> bool:\n    from semantic_kernel.connectors.ai.chat_completion_client_base import ChatCompletionClientBase\n    method = type(service).__dict__.get(\"_inner_get_streaming_chat_message_contents\")\n    return callable(method) and method is not ChatCompletionClientBase._inner_get_streaming_chat_message_contents","typeGuard":"from semantic_kernel.connectors.ai.chat_completion_client_base import ChatCompletionClientBase\n\ndef overrides_streaming_chat(cls: type) -> bool:\n    m = cls.__dict__.get(\"_inner_get_streaming_chat_message_contents\")\n    return callable(m)","tryCatchPattern":"try:\n    async for chunk in service.get_streaming_chat_message_contents(history, settings):\n        process(chunk)\nexcept NotImplementedError as e:\n    if \"_inner_get_streaming_chat_message_contents\" in str(e):\n        raise NotImplementedError(\"Service subclass must implement _inner_get_streaming_chat_message_contents\") from e\n    raise","preventionTips":["Override _inner_get_streaming_chat_message_contents as an async generator in custom services.","Use shipped streaming connectors for real providers.","If the service is non-streaming only, call the non-streaming API."],"tags":["chat-completion","abstract-method","not-implemented","streaming","extensibility"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}