Skip to content

ksivamuthu/color-finder-microsoft-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Color Finder Microsoft Bot

Overview

This is a chat bot using Microsoft Bot Framework that identifies color name from hex and hexcode from color name.

Prerequisites

The minimum prerequisites to run this app are:

  • Latest Node.js with NPM. Download it from here.
  • The Bot Framework Emulator. To install the Bot Framework Emulator, download it from here. Please refer to this documentation article to know more about the Bot Framework Emulator.

Environment Configuration

Key How to get the key
BingSearchAPIKey https://azure.microsoft.com/en-us/try/cognitive-services/?api=bing-web-search-api
ComputerVisionAPIKey https://azure.microsoft.com/en-us/try/cognitive-services/my-apis/?api=computer-vision-api

Load environment values

Create a .env file in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE

BingSearchAPIKey=BING_SEARCH_API_HERE
ComputerVisionAPIKey=COMPUTER_VISION_API_HERE
cp .env-sample .env

Code Details

Hex-Name Conversion

  • This bot is looking for the pattern "find the name of #HEX" and "find the hex of COLORNAME".
  • Extracts the HEX/COLOR NAME value
  • Do lookup
  • Return the result

Computer Vision API Analysis

  • This bot is looking for the pattern "what is the color of OBJECT".
  • Extracts the OBJECT value
  • Search using Bing Image Search API
  • Get the first search result image
  • Call Azure Cognitive Vision API to analyze the image with category "Color" and return the color

Result

img

Credits

Reference