{"id":4898,"library":"botbuilder-core","title":"Microsoft Bot Framework Python SDK (Core)","description":"The `botbuilder-core` library provides the foundational abstractions for building conversational AI bots using the Microsoft Bot Framework in Python. It includes base classes for handling activities, managing turns, and accessing conversation state. As of version 4.17.1, the entire Bot Framework Python SDK has reached End-of-Life (EOL) and will no longer receive updates or support. The project is effectively abandoned.","status":"abandoned","version":"4.17.1","language":"en","source_language":"en","source_url":"https://www.github.com/Microsoft/botbuilder-python","tags":["bot","microsoft","async","conversational-ai","deprecated"],"install":[{"cmd":"pip install botbuilder-core botbuilder-integration-aiohttp","lang":"bash","label":"Install core and AIOHTTP integration"}],"dependencies":[{"reason":"Used for asynchronous HTTP communication and a common web server for bot endpoints.","package":"aiohttp"},{"reason":"Provides the BotFrameworkHttpAdapter to integrate with aiohttp web applications, essential for a runnable bot.","package":"botbuilder-integration-aiohttp","optional":true}],"imports":[{"symbol":"ActivityHandler","correct":"from botbuilder.core import ActivityHandler"},{"symbol":"TurnContext","correct":"from botbuilder.core import TurnContext"},{"note":"While BotFrameworkAdapter is available directly in botbuilder-core, for AIOHTTP integration, BotFrameworkHttpAdapter from botbuilder-integration-aiohttp is typically used instead.","wrong":"from botbuilder.adapters.botframework import BotFrameworkAdapter","symbol":"BotFrameworkAdapter","correct":"from botbuilder.core import BotFrameworkAdapter"},{"note":"This specific adapter is needed to run a bot with the aiohttp web framework.","symbol":"BotFrameworkHttpAdapter","correct":"from botbuilder.integration.aiohttp import BotFrameworkHttpAdapter"}],"quickstart":{"code":"import os\nimport asyncio\nfrom aiohttp import web\nfrom botbuilder.core import ActivityHandler, TurnContext\nfrom botbuilder.schema import Activity\nfrom botbuilder.integration.aiohttp import BotFrameworkHttpAdapter\n\nclass MyEchoBot(ActivityHandler):\n    async def on_message_activity(self, turn_context: TurnContext):\n        await turn_context.send_activity(f\"You said: {turn_context.activity.text}\")\n\n    async def on_members_added_activity(self, members_added: [object], turn_context: TurnContext):\n        for member in members_added:\n            if member.id != turn_context.activity.recipient.id:\n                await turn_context.send_activity(\"Hello and welcome!\")\n\n# Configuration (replace with your actual values or env vars)\n# For local testing without authentication, these can be empty strings\nAPP_ID = os.environ.get(\"MicrosoftAppId\", \"\")\nAPP_PASSWORD = os.environ.get(\"MicrosoftAppPassword\", \"\")\n\n# Create the BotFrameworkHttpAdapter\nadapter = BotFrameworkHttpAdapter(APP_ID, APP_PASSWORD)\n\n# Create the bot instance\nbot = MyEchoBot()\n\n# Listen for incoming requests on /api/messages\nasync def messages(request):\n    if \"application/json\" in request.headers[\"Content-Type\"]:\n        body = await request.json()\n    else:\n        return web.Response(status=400)\n\n    activity = Activity().deserialize(body)\n    auth_header = request.headers[\"Authorization\"] if \"Authorization\" in request.headers else \"\"\n\n    try:\n        response = await adapter.process_activity(activity, auth_header, bot.on_turn)\n        if response:\n            return web.json_response(data=response.body, status=response.status)\n        return web.Response(status=200)\n    except Exception as e:\n        print(f\"Error processing activity: {e}\")\n        return web.Response(status=500, text=str(e))\n\n# Setup AIOHTTP web application\napp = web.Application()\napp.router.post(\"/api/messages\", messages)\n\nif __name__ == \"__main__\":\n    try:\n        web.run_app(app, host=\"localhost\", port=3978)\n    except Exception as e:\n        raise e","lang":"python","description":"This quickstart demonstrates a basic 'echo' bot using `botbuilder-core`'s `ActivityHandler` and `TurnContext`. It's integrated with an `aiohttp` web server via `BotFrameworkHttpAdapter` from `botbuilder-integration-aiohttp` to create a runnable endpoint. Run this code and connect to it using the Bot Framework Emulator or another channel."},"warnings":[{"fix":"Migrate to alternative solutions for building conversational agents, such as the Microsoft 365 Agents SDK or other active bot development frameworks. Do not start new projects with this SDK.","message":"The Microsoft Bot Framework Python SDK, including `botbuilder-core`, has reached End-of-Life (EOL) with version 4.17.1. It is no longer actively maintained, supported, or receiving updates. New development should avoid this library.","severity":"breaking","affected_versions":"4.17.1 and later"},{"fix":"Ensure your development and deployment environments are using Python 3.8 or a later compatible version.","message":"As of SDK version 4.15.0, the underlying `aiohttp` dependency requires Python 3.8 or newer. Bots deployed on Python 3.7 or older will encounter dependency conflicts or runtime errors.","severity":"gotcha","affected_versions":"4.15.0+"},{"fix":"Familiarize yourself with Python's `asyncio` framework. Ensure all methods interacting with `TurnContext` or performing network/disk I/O are `async def` and called using `await`.","message":"The library is built on `asyncio`. All bot logic, especially I/O operations and callbacks, must be `async` and properly `await`ed. Failure to do so can lead to deadlocks, unresponsive bots, or silent failures.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always configure `MicrosoftAppId` and `MicrosoftAppPassword` (preferably via environment variables) for production bots. For local testing, ensure your emulator or client is correctly configured for local authentication or that your adapter is explicitly set to allow unauthenticated access (for development only).","message":"Authentication is crucial for secure bots. Bots typically require `MicrosoftAppId` and `MicrosoftAppPassword` for production deployments. Running locally without these credentials might require specific adapter configurations to disable authentication checks, which is not recommended for production.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Treat the SDK as fully abandoned. The EOL status of 4.17.1 overrides any previous indications.","message":"While a temporary 'deprecation cancelled' notice appeared for version 4.14.5, the SDK ultimately did reach End-of-Life with 4.17.1. This inconsistency might cause confusion for developers checking release notes.","severity":"deprecated","affected_versions":"4.14.5, 4.17.1"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}