Skip to content

A flexible template for creating AI-powered educational apps

Notifications You must be signed in to change notification settings

jsid72/AI-MicroApp-Template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Microapp-Template

Demo

https://ai-microapps.streamlit.app

Overview

This Python application provides a template for creating AI-powered education apps like question generators, debate exercises, critical thinking assessments, and more. Apps can be configured by modifying python configuration files, without needing to touch or understand the core code. And multiple apps can be created by creating multiple configuration files. Apps are built to be customized for your specific use case and shared with others.

Apps can be deployed for free via Streamlit.io. Please see Streamlit's instructions for deploying a web app from a git repository

Structure

Microapps are built by combining fields and phases. Fields capture user input (e.g. responding to a faculty question, indicating a preference). Phases process fields, send a request to the AI, and receive a response. Phases can also be scored. image

Explore the config_demo1.py file to see the supported fields and sample configuration. Explore the config_demo2.py file to see the supported phases and sample configuration.

Requirements

  • Python 3.8+
  • Streamlit
  • AI API Keys (currently, OpenAI, Claude, and Gemini are supported. Want to request other? Submit an issue.)

Installation

  1. Fork the repository

  2. Clone your new forked repository:

    git clone <repository-url>
    cd <repository-folder>
  3. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  4. Install the required packages:

    pip install -r requirements.txt
  5. Set up your OpenAI API key:

    • Create a .env file in the root directory of the project.
    • Add your OpenAI API key to the .env file:
      OPENAI_API_KEY="your_openai_api_key"
    • Optionally, add Gemini and Claude keys
      GOOGLE_API_KEY="your_google_api_key"
      CLAUDE_API_KEY="your_claude_api_key"

Running the Application

To run the Streamlit application, execute the following command:

streamlit run main.py

Configuration

Copy and rename a config file that serves as a good starting point for your app.

Modify the configuration fields, and replace the existing phases and fields with your own.

Edit main.py to add your config file to the templates JSON list in the following format: "Human Readable Name": "config_file_name". Note no .py at the end of the config file name.

Any changes to a config file require a restart of Streamilit

  • Ctrl + C to quit Streamlit from your terminal
  • To start Streamlit again:
streamlit run main.py

Deploy to the web

Follow Streamlit's instructions to deploy your github URL to a free web address hosted by Streamlit. You will need to add your API key(s) to the Streamlit's Secrets area.

About

A flexible template for creating AI-powered educational apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%