Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jac18281828/openai
openai python demo repo
https://github.com/jac18281828/openai
Last synced: about 1 month ago
JSON representation
openai python demo repo
- Host: GitHub
- URL: https://github.com/jac18281828/openai
- Owner: jac18281828
- License: other
- Created: 2024-03-01T16:10:57.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-01T18:17:49.000Z (10 months ago)
- Last Synced: 2024-10-15T19:13:59.667Z (3 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAI ChatGPT API Python Example
This is a demo Python project that demonstrates how to use the OpenAI ChatGPT API to generate conversational responses.
## Prerequisites
Before running this project, make sure you have the following:
- Python 3.6 or higher installed
- OpenAI Python library installed (`openai`)## Installation
1. Clone this repository:
```shell
$ git clone https://github.com/jac18281828/openai.git
```2. Navigate to the project directory:
```shell
$ cd openai
```3. Install the required dependencies:
```shell
$ pip3 install --upgrade pip
$ pip3 install -r requirements.txt
```## Usage
1. Set up your OpenAI API credentials by following the instructions in the [OpenAI API documentation](https://docs.openai.com/authentication/).
2. create `.env` and set `OPENAI_API_KEY` equal to your api key
3. Run the script:
```shell
python3 prompt.py
```## License
This project is licensed under the [BSD-3-Clause License](LICENSE).