A Python "Hello World" application that demonstrates the OpenAI API and usage of Docker Compose to containerize your project. This is a command line utility that returns the value "Hello World" in the written language of your choice.
Python code is located here
- Setup the application
git clone https://github.com/FullStackWithLawrence/openai-hello-world.git
cd openai-hello-world
make init # create a virtual environment
-
Configure OpenAI API. Find and open the file
.env
in the root folder of the project. Add your OpenAI API key, save and close the file. See OpenAI API Getting Started for detailed setup instructions. -
Run the application
source activate
python -m app.hello_world
This application can also run as a Docker container.
make # initializes a .env file for OPENAI_API_KEY and DOCKERHUB_ACCESS_TOKEN
make docker-build # run Docker compose to containerize your application
make docker-run # run the application as a Docker container
Other Docker commands
make docker-push # push your Docker container to DockerHub. A DockerHub account and DOCKERHUB_ACCESS_TOKEN is required.
make docker-prune # prune (permanently delete) all existing data in Docker: containers, images, cache.
- git. pre-installed on Linux and macOS
- make. pre-installed on Linux and macOS.
- OpenAI platform API key. If you're new to OpenAI API then see How to Get an OpenAI API Key
- Python 3.11: for creating virtual environment.
- Docker: the Docker run-time environment for your operating system. Can be installed as a desktop application or as a service (daemon)
- Docker Compose: used to create your production container.
Documentation is available here: Documentation
To get community support, go to the official Issues Page for this project.
This project demonstrates a wide variety of good coding best practices for managing mission-critical cloud-based micro services in a team environment. 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.
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:
- the Developer Setup Guide
- and these commit comment guidelines 😬😬😬 for managing CI rules for automated semantic releases.
You can also contact Lawrence McDaniel directly.