BotFramework-Emulator
A desktop application that allows users to locally test and debug chat bots built with the Bot Framework SDK.
Top Related Projects
The open-source hub to build & deploy GPT/LLM Agents ⚡️
Welcome to the Bot Framework samples repository. Here you will find task-focused samples in C#, JavaScript/TypeScript, and Python to help you get started with the Bot Framework SDK!
Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
Easy to maintain open source documentation websites.
Quick Overview
The Microsoft Bot Framework Emulator is a desktop application that allows developers to test and debug bots built using the Microsoft Bot Framework. It provides a user-friendly interface for interacting with bots, inspecting their activity, and simulating different user inputs.
Pros
- Comprehensive Testing: The emulator enables developers to thoroughly test their bots, including handling different types of user input, verifying bot responses, and debugging any issues that arise.
- Intuitive Interface: The emulator's user interface is designed to be easy to use, with features like message history, variable inspection, and direct API calls.
- Supports Multiple Channels: The emulator can be used to test bots that are deployed on various channels, such as Microsoft Teams, Skype, and Facebook Messenger.
- Extensible: The emulator can be extended with custom plugins, allowing developers to add additional functionality or integrate with other tools.
Cons
- Limited to Desktop: The emulator is a desktop application, which may not be the most convenient option for developers who prefer a web-based or mobile testing environment.
- Specific to Microsoft Bot Framework: The emulator is designed to work with bots built using the Microsoft Bot Framework, which may limit its usefulness for developers working with other bot frameworks or platforms.
- Potential Performance Issues: Depending on the complexity of the bot being tested, the emulator may experience performance issues, especially when dealing with large message histories or complex bot logic.
- Requires Installation: Unlike web-based tools, the emulator needs to be installed on the developer's machine, which can be an additional step in the development and testing workflow.
Getting Started
To get started with the Microsoft Bot Framework Emulator, follow these steps:
- Download and install the latest version of the emulator from the GitHub repository.
- Open the emulator and click on the "Open Bot" button to connect to your bot.
- Enter the endpoint URL for your bot and any required authentication credentials.
- Once connected, you can start interacting with your bot, sending messages, and inspecting the activity log.
To create a new bot using the Microsoft Bot Framework, you can follow the official documentation. Here's a simple example of a bot that echoes back the user's message:
using Microsoft.Bot.Builder;
using Microsoft.Bot.Schema;
using System.Threading.Tasks;
public class EchoBot : IBot
{
public async Task OnTurnAsync(ITurnContext<IMessageActivity> turnContext)
{
// Echo the user's message back to them
await turnContext.SendActivityAsync(MessageFactory.Text($"You said: {turnContext.Activity.Text}"));
}
}
This bot listens for incoming messages and responds by echoing the user's input back to them. You can then test this bot using the Microsoft Bot Framework Emulator to ensure it's working as expected.
Competitor Comparisons
The open-source hub to build & deploy GPT/LLM Agents ⚡️
Pros of Botpress
- Open-source and highly customizable platform for building chatbots
- Supports multiple channels and languages out of the box
- Includes a visual flow editor for easy bot design
Cons of Botpress
- Steeper learning curve for developers new to the platform
- May require more setup and configuration compared to BotFramework-Emulator
Code Comparison
Botpress (JavaScript):
bp.hear(/hello/i, (event, next) => {
bp.messaging.sendText(event.channel.id, 'Hello, human!')
})
BotFramework-Emulator (TypeScript):
server.post('/api/messages', (req, res) => {
adapter.processActivity(req, res, async (context) => {
if (context.activity.type === 'message') {
await context.sendActivity('Hello, human!');
}
});
});
Both examples show how to respond to a user's message, but Botpress uses a more event-driven approach, while BotFramework-Emulator relies on a more traditional server-based setup. Botpress's code is more concise and focused on the bot's behavior, while BotFramework-Emulator's code includes more boilerplate for handling HTTP requests.
Welcome to the Bot Framework samples repository. Here you will find task-focused samples in C#, JavaScript/TypeScript, and Python to help you get started with the Bot Framework SDK!
Pros of BotBuilder-Samples
- Provides a wide range of sample projects and templates for various bot scenarios
- Offers examples in multiple programming languages (C#, JavaScript, Python)
- Includes comprehensive documentation and step-by-step guides for each sample
Cons of BotBuilder-Samples
- Requires more setup and configuration compared to BotFramework-Emulator
- May be overwhelming for beginners due to the large number of samples
- Some samples might become outdated as the Bot Framework evolves
Code Comparison
BotBuilder-Samples (JavaScript):
const { ActivityHandler, MessageFactory } = require('botbuilder');
class EchoBot extends ActivityHandler {
constructor() {
super();
this.onMessage(async (context, next) => {
await context.sendActivity(MessageFactory.text(`Echo: ${context.activity.text}`));
await next();
});
}
}
BotFramework-Emulator (TypeScript):
import { BotEmulator } from '@bfemulator/sdk-shared';
const emulator = new BotEmulator();
emulator.facilities.conversations.addUser({ id: 'user1', name: 'User 1' });
emulator.facilities.conversations.postActivityToBot({ type: 'message', text: 'Hello, bot!' });
The code snippets demonstrate the difference in focus between the two repositories. BotBuilder-Samples provides examples of bot implementation, while BotFramework-Emulator focuses on emulating and testing bot interactions.
Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
Pros of Botkit
- Multi-platform support: Botkit works with various messaging platforms, offering greater flexibility
- Easier to get started: Simpler setup process and more beginner-friendly documentation
- Active community: Large user base and extensive plugin ecosystem
Cons of Botkit
- Less integration with Azure services compared to BotFramework-Emulator
- May require more custom code for complex scenarios
- Limited built-in analytics and debugging tools
Code Comparison
Botkit example:
const { Botkit } = require('botkit');
const controller = new Botkit({
webhook_uri: '/api/messages',
});
controller.hears('hello', 'message', async(bot, message) => {
await bot.reply(message, 'Hi there!');
});
BotFramework-Emulator example:
const { ActivityHandler, MessageFactory } = require('botbuilder');
class EchoBot extends ActivityHandler {
constructor() {
super();
this.onMessage(async (context, next) => {
await context.sendActivity(MessageFactory.text(`You said: ${context.activity.text}`));
await next();
});
}
}
Easy to maintain open source documentation websites.
Pros of Docusaurus
- Designed for creating documentation websites, making it more versatile for various projects
- Offers a wide range of built-in features like versioning, search, and internationalization
- Has a larger and more active community, resulting in frequent updates and extensive resources
Cons of Docusaurus
- Steeper learning curve for developers not familiar with React
- May be overkill for simple documentation needs or small projects
- Requires more setup and configuration compared to BotFramework-Emulator
Code Comparison
BotFramework-Emulator (TypeScript):
import { BotEmulator } from '@bfemulator/sdk';
const emulator = new BotEmulator();
emulator.start();
Docusaurus (JavaScript):
import React from 'react';
import Layout from '@theme/Layout';
function MyPage() {
return <Layout>My custom page content</Layout>;
}
While BotFramework-Emulator focuses on bot development and testing, Docusaurus is a more general-purpose documentation tool. The code snippets reflect their different purposes, with BotFramework-Emulator initializing an emulator instance and Docusaurus creating a custom page using React components.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Find out what's new with Bot Framework
Bot Framework Emulator
The Bot Framework Emulator is a desktop application that allows bot developers to test and debug bots built using the Bot Framework SDK. You can use the Bot Framework Emulator to test bots running either locally on your machine or connect to bots running remotely through a tunnel.
This repo is part the Microsoft Bot Framework - a comprehensive framework for building enterprise-grade conversational AI experiences.
Download
- Download the Bot Framework V4 Emulator for your platform from the GitHub releases page.
Supported platforms
-
Windows
-
OS X
-
Linux
Note for Linux users:
The Emulator leverages a library that uses
libsecret
so you may need to install it before runningnpm install
.Depending on your distribution, you will need to run the following command:
Debian/Ubuntu:
sudo apt-get install libsecret-1-dev
Red Hat-based:
sudo yum install libsecret-devel
Arch Linux:
sudo pacman -S libsecret
Documentation
Checkout the Wiki for docs.
Feedback
- File a bug or suggestion in GitHub Issues
- Ask a question on Stack Overflow
Related
Nightly builds
Nightly builds are generated using the latest code. Therefore, they may not be stable, and most likely lack up to date documentation. These builds are better suited for more experienced users, although everyone is welcome to use them and provide feedback. Nightly builds of the V4 Emulator are available here.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Reporting Security Issues
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.
Copyright (c) Microsoft Corporation. All rights reserved.
Top Related Projects
The open-source hub to build & deploy GPT/LLM Agents ⚡️
Welcome to the Bot Framework samples repository. Here you will find task-focused samples in C#, JavaScript/TypeScript, and Python to help you get started with the Bot Framework SDK!
Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
Easy to maintain open source documentation websites.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot