Git Product home page Git Product logo

cwhiteley / aws-openai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fullstackwithlawrence/aws-openai

0.0 0.0 0.0 40.9 MB

Example ChatGPT chatbots using Langchain and OpenAI

Home Page: https://openai.lawrencemcdaniel.com/

License: GNU Affero General Public License v3.0

Shell 1.39% JavaScript 23.12% Python 30.85% CSS 1.19% Makefile 1.56% HTML 0.40% Smarty 0.18% HCL 39.39% Jupyter Notebook 1.78% Dockerfile 0.13%

aws-openai's Introduction

OpenAI Code Samples

FullStackWithLawrence
OpenAI LangChain Amazon AWS ReactJS Python Terraform
12-Factor Unit Tests GHA pushMain Status Auto Assign Release Notes License: AGPL v3 hack.d Lawrence McDaniel

A React + AWS Serverless full stack implementation of the 30 example applications found in the official OpenAI API documentation. This repository is used as an instructional tool for the YouTube channel "Full Stack With Lawrence" as well as for University of British Columbia course, "Artificial Intelligence Cloud Technology Implementation" taught by Lawrence McDaniel.

Marv

IMPORTANT DISCLAIMER: AWS' Lambda service has a hard 29-second timeout. OpenAI API calls often take longer than this, in which case the AWS API Gateway endpoint will return a 504 "Gateway timeout error" response to the React client. This happens frequently with apps created using chatgpt-4. Each of the 30 OpenAI API example applications are nonetheless implemented exactly as they are specified in the official documentation.

Code composition as of Dec-2023:

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Markdown                        50            739              6           2357
HCL                             23            296            574           1948
Python                          14            352            369           1306
YAML                            19            109            101           1077
JavaScript                      39            112            126           1074
JSX                              5             37             41            771
CSS                              5             31             14            172
make                             1             22             32             82
INI                              2             15              0             69
HTML                             2              1              0             65
Text                             3              3              0             56
Jupyter Notebook                 1              0            186             48
Bourne Shell                     4             10             44             32
TOML                             1              3              0             32
Dockerfile                       1              4              4              7
-------------------------------------------------------------------------------
SUM:                           170           1734           1497           9096
-------------------------------------------------------------------------------

ReactJS chat application

Complete documentation is located here.

React app that leverages Vite.js, @chatscope/chat-ui-kit-react, and react-pro-sidebar.

Webapp Key features

  • robust, highly customizable chat features
  • A component model for implementing your own highly personalized OpenAI apps
  • Skinnable UI for each app
  • Includes default assets for each app
  • Small compact code base
  • Robust error handling for non-200 response codes from the custom REST API
  • Handles direct text input as well as file attachments
  • Info link to the OpenAI API official code sample
  • Build-deploy managed with Vite

Custom OpenAI REST API Backend

Complete documentation is located here.

A REST API implementing each of the 30 example applications from the official OpenAI API Documentation using a modularized Terraform approach. Leverages OpenAI's suite of AI models, including GPT-3.5, GPT-4, DALL·E, Whisper, Embeddings, and Moderation.

API Key features

  • OpenAI API library for Python. LangChain enabled API endpoints where designated.
  • Pydantic based CI-CD friendly Settings configuration class that consistently and automatically manages Python Lambda initializations from multiple sources including bash environment variables, .env and terraform.tfvars files.
  • CloudWatch logging
  • Terraform fully automated and parameterized build. Usually builds your infrastructure in less than a minute.
  • Secure: uses AWS role-based security and custom IAM policies. Best practice handling of secrets and sensitive data in all environments (dev, test, CI-CD, prod). Proxy-based API that hides your OpenAI API calls and credentials. Runs on https with AWS-managed SSL/TLS certificate.
  • Excellent documentation
  • AWS serverless implementation. Free or nearly free in most cases
  • Deploy to a custom domain name

Requirements

Documentation

Detailed documentation for each endpoint is available here: Documentation

Support

To get community support, go to the official Issues Page for this project.

Good Coding Best Practices

This project demonstrates a wide variety of good coding best practices for managing mission-critical cloud-based micro services in a team environment, namely its adherence to 12-Factor Methodology. Please see this Code Management Best Practices for additional details.

We want to make this project more accessible to students and learners as an instructional tool while not adding undue code review workloads to anyone with merge authority for the project. To this end we've also added several pre-commit code linting and code style enforcement tools, as well as automated procedures for version maintenance of package dependencies, pull request evaluations, and semantic releases.

Contributing

We welcome contributions! There are a variety of ways for you to get involved, regardless of your background. In addition to Pull requests, this project would benefit from contributors focused on documentation and how-to video content creation, testing, community engagement, and stewards to help us to ensure that we comply with evolving standards for the ethical use of AI.

For developers, please see:

You can also contact Lawrence McDaniel directly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.