Coder Social home page Coder Social logo

llamaindex-chat-with-streamlit-docs's Introduction

๐Ÿฆ™๐Ÿ“š LlamaIndex - Chat with the Streamlit docs

Build a chatbot powered by LlamaIndex that augments GPT 3.5 with the contents of the Streamlit docs (or your own data).

Overview of the App

  • Takes user queries via Streamlit's st.chat_input and displays both user queries and model responses with st.chat_message
  • Uses LlamaIndex to load and index data and create a chat engine that will retrieve context from that data to respond to each user query

Demo App

Streamlit App

Get an OpenAI API key

You can get your own OpenAI API key by following the following instructions:

  1. Go to https://platform.openai.com/account/api-keys.
  2. Click on the + Create new secret key button.
  3. Next, enter an identifier name (optional) and click on the Create secret key button.

Try out the app

Once the app is loaded, enter your question about the Streamlit library and wait for a response.

llamaindex-chat-with-streamlit-docs's People

Contributors

carolinedlu avatar sfc-gh-cfrasca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

llamaindex-chat-with-streamlit-docs's Issues

Import Error with llama-index

Hi,

I was trying to fork this project from the original interface posted and before editing it in codespaces, I get:

ImportError: cannot import name 'VectorStoreIndex' from 'llama_index' (unknown location)

I was able to get it to work yesterday morning, but have been unable to find a bug in my code to account for it. Please let me know if you can help!
Screenshot 2024-02-13 at 12 40 38

Streamlit chat bot pack download error (max retries)

I am facing this error while downloading the Streamlit chatbot pack,please help:

(venv) PS C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Scripts> llamaindex-cli download-llamapack StreamlitChatPack --download-dir ./streamlit_chatbot_pack
Traceback (most recent call last):
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connection.py", line 203, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
    raise err
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
    sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connectionpool.py", line 790, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request
    raise new_e
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
    self._validate_conn(conn)
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connectionpool.py", line 1096, in _validate_conn
    conn.connect()
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connection.py", line 611, in connect
    self.sock = sock = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connection.py", line 212, in _new_conn
    raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x000001B749585510>, 'Connection to raw.githubusercontent.com timed out. (connect timeout=None)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\urllib3\util\retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /run-llama/llama-hub/main/llama_hub/llama_packs/library.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001B749585510>, 'Connection to raw.githubusercontent.com timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Scripts\llamaindex-cli.exe\__main__.py", line 7, in <module>
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\llama_index\command_line\command_line.py", line 125, in main
    args.func(args)
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\llama_index\command_line\command_line.py", line 83, in <lambda>
    func=lambda args: handle_download_llama_pack(**vars(args))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\llama_index\command_line\command_line.py", line 21, in handle_download_llama_pack
    download_llama_pack(
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\llama_index\llama_pack\download.py", line 29, in download_llama_pack
    pack_cls = download_llama_module(
               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\llama_index\download\module.py", line 216, in download_llama_module
    module_info = get_module_info(
                  ^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\llama_index\download\module.py", line 66, in get_module_info
    library_raw_content, _ = get_file_content(
                             ^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\llama_index\download\utils.py", line 10, in get_file_content
    resp = requests.get(url + path)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Testbook\OneDrive\Desktop\Streamlit\venv\Lib\site-packages\requests\adapters.py", line 507, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /run-llama/llama-hub/main/llama_hub/llama_packs/library.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001B749585510>, 'Connection to raw.githubusercontent.com timed out. (connect timeout=None)'))

Had a query regarding the data folder

Heyy, I was actually wondering that how to convert an entire website's data into an (.md) file or into any other format accepted by llama-index ! I plan to organize a workshop on llama-index and streamlit in my Uni, So thought of using my Uni website as an input to llama-index... Or can it only be done by individual's who host the websites ? Thank-you

ModuleNotFound 'nltk' error

After installing required libs in requirements.txt using pip in a virtual env and running the app, I am getting a ModuleNotFound 'nltk' error even though after I do a 'pip list' command I see nltk installed in the virtualenv that's activated when I run the streamlit app.

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.