Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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).