-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/krisograbek/streamlit_chatb…
…ot_base into main
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
openai | ||
streamlit | ||
python-dotenv |