Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM PDF Chatbot

An example LLM chatbot created with Cohere API and Streamlit that references a PDF document.

Quick Start

  1. Fork and then clone this repository to a folder on your computer.

  2. Open Visual Studio Code and then choose File > Open Folder... to open and edit the code.

  3. Open the terminal window inside Visual Studio Code and type the following command to install the required Python packages.

    pip install -r requirements.txt

    Substitute pip for pip3 if you have problems with this.

  4. Type the following terminal commands to create the necessary secrets file. Not having this will result in an error.

    mkdir .streamlit

    touch .streamlit/secrets.toml

    echo "COHERE_API_KEY = 'PASTE YOUR API KEY HERE'" > .streamlit/secrets.toml

  5. Run the app by typing the following command in the terminal window.

    streamlit run chatbot.py

    A new browser window will open where you can interact with the chatbot.

Note

If you didn't paste a valid Cohere API key into your secrets file you will need to enter it into the sidebar for the chatbot to work.

  1. Make minor changes to the code, save and then run your app again to see what happens.

Challenges

Advanced Challenges

Caution

You should never include your API key in any code that you publish online, especially on GitHub. If someone copies your key they can access Cohere using your account without your permission. Creating a secret on Streamlit is the only way to publish your app to automatically use your API key without exposing it for the world to see.

About

An enhanced Cohere Streamlit based chatbot that connects to external data sources via Langchain.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages