{"id":4901,"library":"botframework-streaming","title":"Microsoft Bot Framework Streaming (Python)","description":"This package is part of the Microsoft Bot Framework Bot Builder SDK for Python, providing the underlying streaming protocol implementation for secure, high-performance communication between bots and clients. The Bot Framework Python SDK, including this library, reached its end-of-life with version 4.17.1, and will no longer receive updates or support. It previously had a regular release cadence as part of the larger SDK.","status":"abandoned","version":"4.17.1","language":"en","source_language":"en","source_url":"https://github.com/Microsoft/botbuilder-python","tags":["bot","microsoft","streaming","bot-framework","azure","end-of-life"],"install":[{"cmd":"pip install botframework-streaming","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides the activity and bot framework schema definitions.","package":"botbuilder-schema","optional":false},{"reason":"Integrates the Bot Framework Adapter with aiohttp for web server functionality, which leverages this streaming library.","package":"botbuilder-integration-aiohttp","optional":false},{"reason":"Microsoft REST client runtime, used for HTTP communication.","package":"msrest","optional":false}],"imports":[{"note":"A low-level client for streaming HTTP requests. Typically not directly used by bot developers.","symbol":"StreamingHttpClient","correct":"from botframework.streaming.bot_framework_http_client import StreamingHttpClient"},{"note":"A low-level client for WebSocket streaming. Typically not directly used by bot developers.","symbol":"StreamingWebSocketClient","correct":"from botframework.streaming.websocket.websocket_client import StreamingWebSocketClient"},{"note":"Base class for handling incoming streaming requests. Used in implementing custom adapters.","symbol":"StreamingRequestHandler","correct":"from botframework.streaming.streaming_request_handler import StreamingRequestHandler"}],"quickstart":{"code":"import asyncio\nimport os\nfrom aiohttp import web\nfrom botbuilder.core import TurnContext, MessageFactory\nfrom botbuilder.integration.aiohttp import CloudAdapter, ConfigurationBotFrameworkAuthentication\nfrom botbuilder.schema import Activity\n\n# NOTE: This example demonstrates how a bot setup would typically use\n# components that internally rely on `botframework-streaming` for communication.\n# As the SDK is EOL, this is for historical context.\n\n# Create a simple bot for demonstration\nclass MyEchoBot:\n    async def on_turn(self, turn_context: TurnContext):\n        if turn_context.activity.type == 'message' and turn_context.activity.text:\n            await turn_context.send_activity(MessageFactory.text(f\"You said: {turn_context.activity.text}\"))\n        else:\n            await turn_context.send_activity(f\"[{turn_context.activity.type} event detected]\")\n\n# Configuration and Adapter setup\napp_id = os.environ.get('MicrosoftAppId', '') # Get from environment or config\napp_password = os.environ.get('MicrosoftAppPassword', '') # Get from environment or config\n\n# Setup Bot Framework Authentication\n# For local testing without credentials, pass None for MicrosoftAppId and MicrosoftAppPassword\nauth = ConfigurationBotFrameworkAuthentication(\n    MicrosoftAppId=app_id,\n    MicrosoftAppPassword=app_password\n)\nadapter = CloudAdapter(auth)\n\n# Instantiate the bot\nbot = MyEchoBot()\n\nasync def messages(req: web.Request):\n    # For authenticated requests (e.g., from Azure Bot Service)\n    if 'Authorization' in req.headers:\n        response = await adapter.process(req, bot)\n        if response:\n            return web.Response(status=response.status, headers=response.headers, body=response.body)\n    else:\n        # Simplified handling for local testing without authentication.\n        # In production, authentication is required.\n        try:\n            activity = await req.json()\n            activity = Activity().deserialize(activity)\n            turn_context = TurnContext(adapter, activity)\n            await bot.on_turn(turn_context)\n            return web.Response(status=200)\n        except Exception as e:\n            print(f\"Error processing request: {e}\")\n            return web.Response(status=500, text=str(e))\n\n    return web.Response(status=202)\n\n\nasync def main():\n    web_app = web.Application()\n    web_app.router.add_post('/api/messages', messages)\n    runner = web.AppRunner(web_app)\n    await runner.setup()\n    site = web.TCPSite(runner, 'localhost', 3978)\n    await site.start()\n    print(\"Bot listening on http://localhost:3978/api/messages\")\n    while True:\n        await asyncio.sleep(3600)\n\nif __name__ == '__main__':\n    try:\n        asyncio.run(main())\n    except KeyboardInterrupt:\n        print(\"Bot stopped.\")","lang":"python","description":"This quickstart demonstrates setting up an `aiohttp` web server to expose a Bot Framework `CloudAdapter`, which internally uses components that leverage `botframework-streaming` for communication. This is the standard way a Python bot would listen for incoming activities, implicitly using streaming capabilities for various channels. Note that the SDK is EOL."},"warnings":[{"fix":"Plan for migration to a different bot development framework. Continue using this SDK at your own risk for existing deployments, but be aware of security and compatibility risks.","message":"The Bot Framework Python SDK, including `botframework-streaming`, reached end-of-life with version 4.17.1. It is no longer updated, maintained, or supported through Azure portal service tickets. Customers should consider migrating to alternative solutions like the Microsoft 365 Agents SDK or other AI agent frameworks.","severity":"breaking","affected_versions":">=4.17.1"},{"fix":"Ensure your Python environment (local or deployment) is running Python 3.8 or a later compatible version.","message":"Starting with SDK version 4.15.0, the underlying `aiohttp` package (version 3.9+) requires Python 3.8 or newer. Bots deployed with older Python versions (e.g., 3.7) will need to be updated to Python 3.8+.","severity":"gotcha","affected_versions":">=4.15.0"},{"fix":"Focus on using the `botbuilder-core` and `botbuilder-integration-aiohttp` packages for standard bot development. Consult advanced documentation if custom streaming behavior is required.","message":"This `botframework-streaming` library provides low-level streaming protocol implementations. Most bot developers will interact with higher-level abstractions like `botbuilder-core.BotFrameworkAdapter` or `botbuilder-integration-aiohttp.CloudAdapter` for bot development, which leverage this library internally. Direct usage of `botframework-streaming` classes is rare.","severity":"gotcha","affected_versions":"<=4.17.1"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}