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

https://github.com/quansight/panel-chat-gpt


https://github.com/quansight/panel-chat-gpt

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

ChatGPT Panel Application
=========================

This repository contains a simple Panel application that provides an interactive interface to communicate with OpenAI's ChatGPT.

Panel is a high-level app and dashboarding solution for Python that makes it easy to create custom web applications with a variety of widgets.

Prerequisites
-------------

* Python 3.7 or higher
* An OpenAI API key for accessing ChatGPT. You can obtain one by signing up on the [OpenAI platform](https://www.openai.com/).

Getting Started
---------------

### 1\. Clone the repository

Clone this repository to your local machine:

bash

```bash
git clone https://github.com/yourusername/chatgpt_panel.git
cd chatgpt_panel
```

### 2\. Create and activate the conda environment

Create a conda environment based on the provided `environment.yaml` file:

bash

```bash
conda env create -f environment.yaml
```

Activate the created environment:

bash

```bash
conda activate panelchat
```
### 3\. Set your OpenAI API key

Create a new file named `.env` in the project directory:

bash

```bash
touch .env
```

Add your OpenAI API key to the `.env` file:

```
OPENAI_API_KEY=your_api_key_here
```

Replace `your_api_key_here` with your actual OpenAI API key. The application will read the API key from the environment variable stored in the `.env` file.

### 4\. Run the application

Start the Panel server and launch the application:

bash

```bash
panel serve src/app.py
```

The application will open in your default web browser at `http://localhost:5006/app`.

Usage
-----

The web interface provides an input field and a "Send" button. Type your message in the input field and click the "Send" button or press Enter to send your message to ChatGPT. The response from ChatGPT will appear in the text area above the input field.

Limitations
-----------

Be aware of the costs and rate limits associated with using the OpenAI API. Each interaction with the ChatGPT API will count towards your usage limits.

* This readme was partially generated by chatGPT. *