Skip to content

Commit

Permalink
Add Dockerfile for containerization
Browse files Browse the repository at this point in the history
  • Loading branch information
AutoPR committed May 8, 2023
1 parent 880c988 commit b731323
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/python/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
### This is a Python script that uses the OpenAI API to perform text-based chat with the GPT-3.5 Turbo language model. The script sends a message as input to the API and receives a response message from the API.

Requirements
To use this script, you need to have an OpenAI API key. You can sign up for an API key at [https://platform.openai.com/signup/](https://platform.openai.com/signup/).

You also need to have the
requests and json Python modules installed. You can install these modules using pip:
{
"outcome": "Successfully rewrote hunk."
}
{
"outcome": "Successfully rewrote hunk."
}
docker build -t my-app .
```
```python
pip install requests
pip install json
2. Run the Docker container:
```bash
docker run -e "OPENAI_API_KEY=<your-api-key>" my-app
```

How to Use
To use the script, run it in a Python environment that has access to your OpenAI API key. You can set your API key in an environment variable called
OPENAI_API_KEY.
When you run the container, the script will run inside the container and display the response message from the API. The script keeps track of the chat history, which is stored in the CHAT_HISTORY list.

When you run the script, you will see a prompt asking you to type your message. Type your message and press Enter to send it to the API. The script will then display the response message from the API.
Disclaimer:

This script is for educational purposes only and should not be used for any other purpose. The use of the OpenAI API is subject to the OpenAI API Terms of Service.

The script keeps track of the chat history, which is stored in the CHAT_HISTORY list.

To quit the script, type "q" and press Enter.

**Disclaimer**

This script is for educational purposes only and should not be used for any other purpose. The use of the OpenAI API is subject to the OpenAI API Terms of Service.
This script is for educational purposes only and should not be used for any other purpose. The use of the OpenAI API is subject to the OpenAI API Terms of Service.

0 comments on commit b731323

Please sign in to comment.