Microsoft Bot Framework SDK for Python

repository·main·Indexed 21 days ago

https://github.com/microsoft/botbuilder-python

A comprehensive framework for building enterprise-grade conversational AI experiences. The SDK allows developers to model conversations and build sophisticated bot applications, including support for LUIS language understanding, multi-turn conversations via Dialogs, and interrupt handling. It provides deployment templates for BotApp and AzureBot via Azure CLI, supporting various authentication types including MultiTenant, SingleTenant, and UserAssignedMSI.

Tokens
15.6K
Snippets
44
Records
73
Agent score
70%

What's inside microsoft-botbuilder-python

  1. CoreBot capabilities overview

    main

    CoreBot is a Bot Framework v4 sample designed to demonstrate several key bot development patterns:

    • Language Understanding: Using LUIS to implement core AI capabilities.
    • Multi-turn Conversations: Implementing complex flows using Dialogs.
    • Interrupt Handling: Managing user interruptions such as Help or Cancel commands.
    • Data Validation: Prompting for and validating specific information requested from the user.
  2. Important: Bot Framework Python SDK Archival Notice

    main

    ARCHIVE NOTICE

    This repository is being archived and will no longer be updated or maintained.

    • Support Status: The tool will no longer receive product updates and will not be supported through Azure portal service tickets. Support for the Bot Framework SDK will cease after December 31, 2025.
    • Recommended Alternative: For building agents with AI services, orchestration, and knowledge, use the Microsoft 365 Agents SDK. The Agents SDK supports C#, JavaScript, and Python.
    • Migration: If you have an existing bot, you can migrate to the Agents SDK using the migration guidance.
  3. Import a local LUIS application to luis.ai

    main

    Use the luis import application command to upload a local LUIS JSON model to the LUIS service.

    Required parameters:

    • --region: The authoring region (e.g., westus, westeurope, australiaeast).
    • --authoringKey: Your LUIS Authoring Key.
    • --appName: The name of your application.
    • --in: Path to the local JSON file.

    Important: The command returns a JSON object containing an id and activeVersion. You must save these values to use in subsequent training and publishing steps.

    luis import application --region "LuisAppAuthoringRegion" --authoringKey "LuisAuthoringKey" --appName "FlightBooking" --in "./cognitiveModels/FlightBooking.json"
  4. Install RC builds from TestPyPI

    main

    To consume release candidate (rc) builds of the BotBuilder SDK, you must point pip to the TestPyPI index. Use the --index-url flag to specify the TestPyPI simple index URL. Replace botbuilder-core with the specific library name you wish to install.

    $ pip install --index-url https://test.pypi.org/simple/ botbuilder-core
  5. Run the CoreBot sample

    main

    To run the CoreBot sample locally, follow these steps:

    1. Install dependencies: Run pip install -r requirements.txt to install all necessary Python packages.
    2. Configure LUIS: Open config.py and update the following keys with the credentials retrieved from your LUIS portal:
      • LuisAppId
      • LuisAPIKey
      • LuisAPIHostName
    3. Start the bot: Execute python app.py to launch the application.
    pip install -r requirements.txt
    # Update config.py with LuisAppId, LuisAPIKey, and LuisAPIHostName
    python app.py
  6. Deploy BotApp and AzureBot using Azure CLI

    main

    To deploy a bot using these templates, you must deploy the BotApp before the AzureBot. The deployment is performed using the Azure CLI az deployment sub create command.

    Deployment Workflow:

    1. Authenticate with Azure using az login.
    2. Execute the deployment command providing the template file, the target region, and a parameters file.

    Command Syntax:

    az login
    az deployment sub create --template-file <template-file> --location <bot-region> --parameters @<parameters-file>