Skip to content

manekinekko/angular-openai-chat

Repository files navigation

OpenAI Chat

Description

This project is a simple chatbot that uses OpenAI's GPT-3 API to generate responses to user input. It is built using Angular and Material Design.

Installation

Run npm install to install the project dependencies.

Configuration

  1. Create an account on OpenAI.
  2. Create an API key on OpenAI's API Keys page.
  3. Create an .env file under ./api and add the following environment variables:
OPENAI_API_KEY=<YOUR OPENAI API KEY>

Development server

Run npx swa start for a dev server. Navigate to http://localhost:4280/. The application will automatically reload if you change any of the source files.

Build

Run npx swa build to build the project. The build artifacts will be stored in the dist/openai-chat directory for the Angular application and ./api directory for the API.

Deploy

Run npx swa deploy to deploy the application to Azure Static Web Apps. You will be prompted to login to Azure and select a subscription and resource group. You will also be prompted to create a new Static Web App or select an existing one.

Note: You will need to add the OPENAI_API_KEY environment variable to your Static Web App's configuration. Read more about environment variables.

About

A chatbot that uses OpenAI's GPT API to generate responses to user input.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project