Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ot_base into main
  • Loading branch information
krisograbek committed Jul 14, 2023
2 parents fcac0d0 + 0281223 commit e47e663
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Krzysztof Ograbek

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Template for creating your own ChatGPT with Streamlit and OpenAI API

This repository contains the code for a simple web application built with [Streamlit](https://streamlit.io/), which uses OpenAI's GPT-3 model for generating AI responses in a chat-like interface.

### Prerequisites
1. Python 3.6 or above
2. An OpenAI API Key


### Steps to run the application
1 Clone the repository to your local machine:
```shell
git clone https://github.com/krisograbek/streamlit_chatbot_base.git
```

2. Navigate to the project directory:
```shell
cd streamlit_chatbot_base
```

3. Create a virtual environment and activate it:

On macOS and Linux:
```shell
python3 -m venv myenv
source myenv/bin/activate
```

On Windows:
```shell
python -m venv myenv
.\myenv\Scripts\activate
```

4. Install the necessary Python packages:
```shell
pip install -r requirements.txt
```

5. Create a .env file in the root directory of the project and add your OpenAI API key:
```shell
echo OPENAI_API_KEY=your-api-key > .env
```

Please replace your-api-key with your actual OpenAI API key.

6. Run the Streamlit application:
```shell
streamlit run chatbot.py
```

Open a web browser and navigate to http://localhost:8501 to interact with the application.

License
This project is open source, under the terms of the MIT license.

Note: This app makes requests to OpenAI's servers whenever the chat is used. Please be aware of this, especially if you're on a paid plan with OpenAI.
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
openai
streamlit
python-dotenv

0 comments on commit e47e663

Please sign in to comment.