Skip to content

Latest commit

 

History

History
411 lines (308 loc) · 16.5 KB

README.md

File metadata and controls

411 lines (308 loc) · 16.5 KB

Contributors Forks Stargazers Issues MIT License LinkedIn


AI Hackathon Starter Kit

powered by
Logo
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments
  9. References

About The Project

Video walkthrough

Welcome to the AI Hackathon Starter Kit! This project has been created to make AI accessible and easy for everyone. Whether you are a beginner with no prior experience or an experienced developer, this starter kit is designed to help you incorporate AI into your apps quickly and easily.

The AI Hackathon Starter Kit has many features that make it an excellent tool for anyone looking to work with AI.

The tool showcases how to work with the following use cases:

  • Transcription (Speech to Text)
  • Text Analytics
    • Sentiment Analysis
    • Entity Recognition
    • Special Entity Recognition for Healthcare
    • Pii Recognition
  • Speak (Text to Speech)
  • Natural Language Generation

Web Application

This kit removes the complexity of working with AI and allows you to focus on building your app. We have added placeholders for you to add your code and get started quickly. Search for the text "NOTE TO DEVELOPER: YOUR_MAGIC_GOES_HERE" to find the placeholders.

var timeoutId = setTimeout(() => {
    /**
     * ***************************************
     * NOTE TO DEVELOPER: YOUR_MAGIC_GOES_HERE
     * ***************************************
     * This is where you would do interesting things 
     * with the words that were spoken.
     */
    setWordsSpoken((prev:string) => {
        return prev + " " + event.privText;
    });
}, wordOffset);

(back to top)

Built With

These usecases leverage the following technologies:

Major cloud technologies/frameworks/libraries are listed here:

  • Azure
  • OpenAI
  • Node.js
  • Express
  • Material
  • React

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Create Cloud Services

To use this starter kit, you will need the following cloud services:

  1. Create a free Azure account here.
  2. Create a free OpenAI account here.
  3. Sign up for the Azure Cognitive Services Speech API here.
  4. Sign up for the Azure Cognitive Services Language API here.
  5. Sign up for the Azure Cognitive Services OpenAI API here.

To learn more about setting up your cloud resources, please visit see cloud-setup.

Setup Local Development Environment

  1. Node.js: Check if you have Node.js installed by running the following command in your terminal:
    node -v

    Please validate that the version is 18.15 or higher.

  2. Npm: Check if you have npm installed by running the following command in your terminal:
    npm -v

    Please validate that the version is 9.6 or higher.

  3. Git
  4. Visual Studio Code

Prepare your environment

A sample environment file has been provided for you to use. You will need to update the values in the file with your own values.

  1. Open up a text editor and get a copy of the evnironment file from: github.com/rohit-lakhanpal/ai-hackathon-starter-kit/blob/main/src/api/.env-sample

  2. Update the values in the .env file with your own values.

    PORT=8730    
    APP_NAME="YOUR_APP_NAME"
    APP_DESCRIPTION="YOUR_APP_DESCRIPTION"
    APP_REPOSITORY_OPTIONAL="YOUR_APP_REPOSITORY_URL (Optional. If you remove this line, it defaults to this repository's url.)"
    APP_LOGO_OPTIONAL="YOUR_APP_LOGO_URL (Optional. If you can remove this line, it defaults to the Microsoft logo.)"
    APP_FAVICON_OPTIONAL="YOUR_APP_FAVICON_URL (Optional. You can remove this line, it defaults to the Microsoft favicon.)"
    LANGUAGE_KEY="YOUR_AZURE_LANGUAGE_KEY"
    LANGUAGE_REGION="[e.g. eastus]"
    LANGUAGE_ENDPOINT_URL="[e.g. https://your-deployment-name.cognitiveservices.azure.com/]"
    SPEECH_KEY="YOUR_AZURE_SPEECH_KEY"
    SPEECH_REGION="YOUR_AZURE_SPEECH_REGION"
    SPEECH_ENDPOINT_URL_OPTIONAL="YOUR_AZURE_SPEECH_ENDPOINT_URL (Optional. You can remove this line if you don't have a custom speech endpoint url.)"
    OPENAI_TYPE="Must be either openai or azure"
    OPENAI_KEY="YOUR_OPENAI_KEY"
    OPENAI_AZURE_KEY="YOUR_OPENAI_AZURE_KEY"
    OPENAI_AZURE_BASE_URL="[e.g. https://[your-deployment-name].openai.azure.com/]"
    OPENAI_AZURE_API_VERSION_OPTIONAL="2023-03-15-preview"
    OPENAI_AZURE_MODELS_TEXT="YOUR_MODEL_DEPLOYMENT_NAME_FOR_text-davinci-003"
    OPENAI_AZURE_MODELS_CHAT="YOUR_MODEL_DEPLOYMENT_NAME_FOR_gpt-35-turbo_or_GPT-4"

Installation

  1. Clone the repo

    git clone https://github.com/rohit-lakhanpal/ai-hackathon-starter-kit.git
  2. Navigate to the src folder

    cd ai-hackathon-starter-kit/src

    Here you will notice two folders:

    • api: This is the backend api that will be used to call cloud services.
    • ui: This is the frontend web application that will be used to interact with the user.

    Let's start with the api first.

API

  1. Navigate to the api project folder
    cd ai-hackathon-starter-kit/src/api    
  2. Create a .env file and update the values with your own values from the step above.
    cp .env-sample .env
  3. Install NPM packages
    npm install
  4. Run the api
     npm start

Your APIs should now be running on at localhost:8730. Test the api by navigating to http://localhost:8730/api/status. You should see the following response:

{
  "status":"200OK"
}

API Application

UI

  1. Navigate to the web project folder and npm install
    cd ai-hackathon-starter-kit/src/ui    
  2. Create a .env file using the .env-sample as a base. In the UI project, the only value you need to update is the PORT value (in case you want to run it on a port other than 8700).
    cp .env-sample .env
  3. Install NPM packages
    npm install
  4. Start the web application
     npm start

Your web application should now be running on at localhost:8700. Test the web application by navigating to http://localhost:8700.

Note: If you changed the port in the .env file, please use that port instead of 8700.

You should see the following response:

Web Application

(back to top)

Usage

Whether you are building a chatbot, voice assistant, or any other type of AI-powered application, this starter kit provides you with all the tools you need to get started. So why wait? Download the AI Hackathon Starter Kit today and start building amazing AI-powered applications!

For more examples, please refer to the Documentation

(back to top)

Roadmap

  • Add Support for Chat Completion
  • Add Form Recognizer Use Cases

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project: Fork the repo you want to contribute to by clicking the Fork button on the top right corner of the repo page.
  2. Clone the Repo: Clone the forked repo to your local machine using the command (git clone URL_OF_FORK).
  3. Branch: Create your Feature Branch (git checkout -b feature/AmazingFeature)
  4. Commit: Commit your Changes (git commit -m 'Add some AmazingFeature')
  5. Push to the Branch: (git push origin feature/AmazingFeature)
  6. Open a Pull Request: Go to your forked repo on GitHub and click Contribute and then Open a pull request. Fill out the details of your pull request and submit it.

Learn more about contributing to projects here.

(back to top)

Disclaimer

This template is provided "as is" without warranty of any kind, whether express or implied. Use at your own risk! The author will not be liable for any losses or damages associated with the use of this template.

It is intended to be used as a starting point for your own project and not as a final product.

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Rohit Lakhanpal - @about_me - [email protected]

Project Link: https://github.com/rohit-lakhanpal/ai-hackathon-starter-kit

(back to top)

Acknowledgments

(back to top)

References

Special thanks to Github Copilot for helping me code this sample. Much love! 

Generated by AI, edited by humans. 

(back to top)