GithubHelp home page GithubHelp logo

ash956901 / chatbot Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 6 KB

A streamlit based chat bot using cohere ai to leverage its llm to build text responses in gpt like manner

Home Page: https://ash956901-chatbot-main-4sbaa2.streamlit.app/

Python 100.00%
ai ai-ml chatbot chatbot-application cohere cohereai coral llm ml streamlit streamlit-webapp chatbot-application-web

chatbot's Introduction

This README file provides an extensive guide on setting up and running a Chat Bot using Streamlit and Cohere API. The bot allows for interactive conversation and showcases messages from both the user and the assistant.

Table of Contents

Introduction

This project implements a simple chat bot using Streamlit for the web interface and Cohere's API for generating responses. The chat bot can engage in a conversation with users, displaying messages from both the user and the assistant in a chat-like format.

Features

  • Interactive chat interface
  • Real-time message display
  • Uses Cohere API for generating responses
  • Session state management to keep track of conversation history

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Python 3.7 or higher
  • Streamlit library
  • Cohere library
  • A Cohere API key

Installation

  1. Clone this repository:

    git clone https://github.com/your-username/chat-bot.git
    cd chat-bot
  2. Create a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required libraries:

    pip install streamlit cohere

Usage

  1. Set up your Cohere API key in Streamlit secrets. Create a file named .streamlit/secrets.toml in the root directory of your project and add the following:

    [secrets]
    COHERE_API_KEY = "your_cohere_api_key"
  2. Run the Streamlit app:

    streamlit run app.py
  3. Open your web browser and navigate to http://localhost:8501 to interact with the chat bot.

Project Structure

chat-bot/ ├── .streamlit/ │ └── secrets.toml ├── app.py ├── README.md └── venv/

  • .streamlit/secrets.toml: Contains the API key for Cohere.
  • app.py: The main script for running the Streamlit app.
  • README.md: This README file.
  • venv/: The virtual environment directory (not included in the repository).

Configuration

Streamlit Secrets

The Cohere API key is stored securely in Streamlit secrets. Ensure you add your key in the .streamlit/secrets.toml file as shown above.

Session State

The app uses Streamlit's session state to keep track of the conversation history. Messages are stored in st.session_state["messages"] and are displayed in the chat container.

Contributing

Contributions are welcome! Please fork the repository and use a feature branch. Pull requests are reviewed on a regular basis.

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/feature-name).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin feature/feature-name).
  5. Create a new Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


This README provides a comprehensive guide to setting up and using the chat bot. If you encounter any issues or have suggestions for improvements, please feel free to open an issue or contribute to the project.

chatbot's People

Contributors

ash956901 avatar

Stargazers

 avatar Sanchit Vijay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.