Skip to content

Commit

Permalink
Merge pull request #6 from FullStackWithLawrence/next
Browse files Browse the repository at this point in the history
docs: add instructions for python and docker
  • Loading branch information
lpm0073 committed Jan 8, 2024
2 parents 5a03c39 + 2f1fa49 commit 00a24ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,24 @@ A Python "Hello World" application that demonstrates the OpenAI API and usage of
git clone https://github.com/FullStackWithLawrence/openai-hello-world.git
cd openai-hello-world
make init # create a virtual environment
make build # run Docker compose to containerize your application
make run # run the application as a Docker container
```

2. 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](./doc/OPENAI_API_GETTING_STARTED_GUIDE.md) for detailed setup instructions.

### Run Python on the command line

```console
source venv/bin/activate
python -m app.hello_world "Chinese"
```

### Build and run with Docker

```console
make build # run Docker compose to containerize your application
make run # run the application as a Docker container
```

Sample output:

```console
Expand Down
2 changes: 1 addition & 1 deletion app/hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A simple Python example of using the OpenAI API to translate "Hello World" to a popular language.
to run in dev:
python3 -m app.hello_world "Chinese"
python -m app.hello_world "Chinese"
to run in prod:
CONTAINER_NAME=hello_world
Expand Down

0 comments on commit 00a24ce

Please sign in to comment.