Adding OpenAI API features into XBlocks

Greetings all, i created this full stack serverless project consisting of a React app + REST API that implements all 30 example applications from the OpenAI API documentation. It provides a pretty good roadmap for how to build OpenAI chat features into your XBlocks. I also deployed it to my personal domain at openai.lawrencemcdaniel.com you’d like to see how it works.

Key React features include:

  • 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

Key backend features include:

  • Built on the OpenAI API Python Library
  • Customizable. Modularized endpoints that only take a few lines of code each.
  • Highly secure. Your OpenAI API key is stored in a local .env file, and is kept safe during development, build and deployment to production.
  • Implements excellent CloudWatch logs for Lambda as well as API Gateway
  • Fully automated and parameterized Terraform build
  • well documented code plus supplemental documentation resources as well as detailed documentation on each URL endpoint.
  • Low-cost AWS serverless implementation using AWS API Gateway and AWS Lambda; free or nearly free in most cases
  • Robust, performant and infinitely scalable
  • Fast build time; usually less than 60 seconds to fully implement
  • Includes both Python and Node.js Lambda examples
  • Deploy https to a custom domain
  • Preconfigured Postman files for testing
  • includes AWS API Gateway usage policy and api key
  • Full CORS configuration
2 Likes