akuz / openai_simple_chat

Project uses OpenAI API to generate text completions in a Flask web chat app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenAI Simple Chat

This project demonstrates the use of OpenAI's API to generate text completions in a simple web-based chat application. The application has two versions - Flask and Streamlit - that allows users to interact with a chatbot and generate responses based on their input. The chatbot uses the OpenAI API to generate text completions based on a given prompt and topic.

License: MIT Forks Stars Issues GitHub contributors

Getting Started

To use this application, you will need to sign up for an API key from OpenAI, which you can do here. Once you have an API key, you can set it as an environment variable on your system.

Flask

To run the Flask application, simply clone the repository and run the openai_simple_chat.py file. The application will be available at http://localhost:5000/.

Streamlit

To run the Streamlit application, you need to have the streamlit library installed on your system. You can install it using pip install streamlit. Then, navigate to the streamlit directory and run streamlit run openai_simple_chat_streamlit.py. The application will be available at http://localhost:8501.

Using the Application

The application has two main pages: the home page, where you can enter a topic and select a prompt, and the answer page, where the generated text completion will be displayed. The home page also has a form to download the answer as a markdown file.

Built With

  • Flask - A micro web framework for Python
  • Streamlit - An open-source app framework for machine learning and data science teams
  • OpenAI - A platform for training and deploying machine learning models

Author

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Thanks to OpenAI for providing the API and the models used in this application
  • Inspiration for this project came from the desire to explore the capabilities of GPT-3 and its use in web applications.

About

Project uses OpenAI API to generate text completions in a Flask web chat app.

License:MIT License


Languages

Language:Python 57.3%Language:HTML 42.7%