Attention course content creators and XBlock developers, I just published a great way to add custom OpenAI applications to your course content via serverless AWS infrastructure. See https://github.com/FullStackWithLawrence/aws-openai. To help you get started, this project includes all 30 of the OpenAI Example Applications from the official OpenAI API Documentation.
It is implemented as a serverless microservice using AWS API Gateway, Lambda and the OpenAI Python Library, and leverages OpenAI’s suite of AI models, including GPT-3.5, GPT-4, DALL·E, Whisper, Embeddings, and Moderation. The JSON-to-JSON workflow of this api lends itself well both to customized html course content blocks as well as integration into XBlocks.
Creating new OpenAI applications and endpoints for this API only takes a few lines of code and is as easy as it is fun! Follow this link to see how each of the 30 example applications are coded.