├── .github └── workflows │ ├── actions.yml │ └── mkdocs.yml ├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.md ├── docs ├── contributing.md ├── creating-streamlit-component.md └── index.md ├── examples └── chatbot.py ├── mkdocs.yml ├── pip-requirements.txt ├── requirements-stc.txt ├── requirements.txt ├── setup.py ├── streamlit_chat ├── __init__.py └── frontend │ ├── .eslintrc.cjs │ ├── build │ ├── asset-manifest.json │ ├── index.html │ ├── precache-manifest.c29a79fbc77e2c50510d007756686dac.js │ ├── service-worker.js │ └── static │ │ ├── css │ │ ├── 2.95a91b17.chunk.css │ │ └── 2.95a91b17.chunk.css.map │ │ ├── js │ │ ├── 2.e1848dfc.chunk.js │ │ ├── 2.e1848dfc.chunk.js.LICENSE.txt │ │ ├── 2.e1848dfc.chunk.js.map │ │ ├── main.87350243.chunk.js │ │ └── main.87350243.chunk.js.map │ │ └── media │ │ ├── KaTeX_AMS-Regular.10824af7.woff │ │ ├── KaTeX_AMS-Regular.56573229.ttf │ │ ├── KaTeX_AMS-Regular.66c67820.woff2 │ │ ├── KaTeX_Caligraphic-Bold.497bf407.ttf │ │ ├── KaTeX_Caligraphic-Bold.a9e9b095.woff2 │ │ ├── KaTeX_Caligraphic-Bold.de2ba279.woff │ │ ├── KaTeX_Caligraphic-Regular.08d95d99.woff2 │ │ ├── KaTeX_Caligraphic-Regular.a25140fb.woff │ │ ├── KaTeX_Caligraphic-Regular.e6fb499f.ttf │ │ ├── KaTeX_Fraktur-Bold.40934fc0.woff │ │ ├── KaTeX_Fraktur-Bold.796f3797.woff2 │ │ ├── KaTeX_Fraktur-Bold.b9d7c449.ttf │ │ ├── KaTeX_Fraktur-Regular.97a699d8.ttf │ │ ├── KaTeX_Fraktur-Regular.e435cda5.woff │ │ ├── KaTeX_Fraktur-Regular.f9e6a99f.woff2 │ │ ├── KaTeX_Main-Bold.4cdba646.woff │ │ ├── KaTeX_Main-Bold.8e431f7e.ttf │ │ ├── KaTeX_Main-Bold.a9382e25.woff2 │ │ ├── KaTeX_Main-BoldItalic.52fb39b0.ttf │ │ ├── KaTeX_Main-BoldItalic.5f875f98.woff │ │ ├── KaTeX_Main-BoldItalic.d8737343.woff2 │ │ ├── KaTeX_Main-Italic.39349e0a.ttf │ │ ├── KaTeX_Main-Italic.65297062.woff2 │ │ ├── KaTeX_Main-Italic.8ffd28f6.woff │ │ ├── KaTeX_Main-Regular.818582da.ttf │ │ ├── KaTeX_Main-Regular.f1cdb692.woff │ │ ├── KaTeX_Main-Regular.f8a7f19f.woff2 │ │ ├── KaTeX_Math-BoldItalic.1320454d.woff2 │ │ ├── KaTeX_Math-BoldItalic.48155e43.woff │ │ ├── KaTeX_Math-BoldItalic.6589c4f1.ttf │ │ ├── KaTeX_Math-Italic.d8b7a801.woff2 │ │ ├── KaTeX_Math-Italic.ed7aea12.woff │ │ ├── KaTeX_Math-Italic.fe5ed587.ttf │ │ ├── KaTeX_SansSerif-Bold.0e897d27.woff │ │ ├── KaTeX_SansSerif-Bold.ad546b47.woff2 │ │ ├── KaTeX_SansSerif-Bold.f2ac7312.ttf │ │ ├── KaTeX_SansSerif-Italic.e934cbc8.woff2 │ │ ├── KaTeX_SansSerif-Italic.ef725de5.woff │ │ ├── KaTeX_SansSerif-Italic.f60b4a34.ttf │ │ ├── KaTeX_SansSerif-Regular.1ac3ed6e.woff2 │ │ ├── KaTeX_SansSerif-Regular.3243452e.ttf │ │ ├── KaTeX_SansSerif-Regular.5f8637ee.woff │ │ ├── KaTeX_Script-Regular.1b3161eb.woff2 │ │ ├── KaTeX_Script-Regular.a189c37d.ttf │ │ ├── KaTeX_Script-Regular.a82fa2a7.woff │ │ ├── KaTeX_Size1-Regular.0d8d9204.ttf │ │ ├── KaTeX_Size1-Regular.4788ba5b.woff │ │ ├── KaTeX_Size1-Regular.82ef26dc.woff2 │ │ ├── KaTeX_Size2-Regular.1fdda0e5.ttf │ │ ├── KaTeX_Size2-Regular.95a1da91.woff2 │ │ ├── KaTeX_Size2-Regular.b0628bfd.woff │ │ ├── KaTeX_Size3-Regular.4de844d4.woff │ │ ├── KaTeX_Size3-Regular.9108a400.woff2 │ │ ├── KaTeX_Size3-Regular.963af864.ttf │ │ ├── KaTeX_Size4-Regular.27a23ee6.ttf │ │ ├── KaTeX_Size4-Regular.3045a61f.woff │ │ ├── KaTeX_Size4-Regular.61522cd3.woff2 │ │ ├── KaTeX_Typewriter-Regular.0e046058.woff │ │ ├── KaTeX_Typewriter-Regular.6bf42875.ttf │ │ └── KaTeX_Typewriter-Regular.b8b8393d.woff2 │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── public │ └── index.html │ ├── src │ ├── Chat.tsx │ ├── avatar.tsx │ ├── index.css │ ├── main.tsx │ ├── message.tsx │ ├── stChat.css │ ├── stChat.tsx │ └── vite-env.d.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── test_component.py └── todo.txt /.github/workflows/actions.yml: -------------------------------------------------------------------------------- 1 | name: Build and release 2 | on: 3 | # Triggers the workflow on push or pull request events but only for the main branch 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 10 | jobs: 11 | # This workflow contains a single job called "build" 12 | build: 13 | # The type of runner that the job will run on 14 | runs-on: ubuntu-latest 15 | 16 | # Steps represent a sequence of tasks that will be executed as part of the job 17 | steps: 18 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 19 | - uses: actions/checkout@v2 20 | - uses: actions/setup-node@v2 21 | with: 22 | node-version: "16" 23 | - uses: actions/setup-python@v2 24 | with: 25 | python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax 26 | architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified 27 | # Runs a single command using the runners shell 28 | # - name: install node dependencies 29 | # run: | 30 | # cd streamlit_chat/frontend 31 | # npm install 32 | 33 | # - name: build frontend 34 | # run: | 35 | # npm run build 36 | # cd ../.. 37 | # Runs a set of commands using the runners shell 38 | - name: install python dependencies 39 | run: pip install -r requirements.txt 40 | - name: build package 41 | run: python setup.py sdist bdist_wheel 42 | 43 | - uses: actions/upload-artifact@v2 44 | with: 45 | path: dest/* 46 | -------------------------------------------------------------------------------- /.github/workflows/mkdocs.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | push: 4 | branches: 5 | - main 6 | permissions: 7 | contents: write 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-python@v4 14 | with: 15 | python-version: 3.x 16 | - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV 17 | - uses: actions/cache@v3 18 | with: 19 | key: mkdocs-material-${{ env.cache_id }} 20 | path: .cache 21 | restore-keys: | 22 | mkdocs-material- 23 | - run: pip install mkdocs-material 24 | - run: mkdocs gh-deploy --force 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | # build/ 12 | develop-eggs/ 13 | # dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | # frontend 132 | .prettierrc 133 | 134 | # Logs 135 | logs 136 | *.log 137 | npm-debug.log* 138 | yarn-debug.log* 139 | yarn-error.log* 140 | pnpm-debug.log* 141 | lerna-debug.log* 142 | 143 | node_modules 144 | dist 145 | dist-ssr 146 | *.local 147 | 148 | # Editor directories and files 149 | .vscode/* 150 | !.vscode/extensions.json 151 | .idea 152 | .DS_Store 153 | *.suo 154 | *.ntvs* 155 | *.njsproj 156 | *.sln 157 | *.sw? 158 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Yash AI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include streamlit_chat/frontend/dist * 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # st-chat 2 | 3 | Streamlit Component, for a Chat-bot UI, [example app](https://share.streamlit.io/ai-yash/st-chat/main/examples/chatbot.py) 4 | 5 | authors - [@yashppawar](https://github.com/yashppawar) & [@YashVardhan-AI](https://github.com/yashvardhan-ai) 6 | 7 | ## Installation 8 | 9 | Install `streamlit-chat` with pip 10 | ```bash 11 | pip install streamlit-chat 12 | ``` 13 | 14 | usage, import the `message` function from `streamlit_chat` 15 | ```py 16 | import streamlit as st 17 | from streamlit_chat import message 18 | 19 | message("My message") 20 | message("Hello bot!", is_user=True) # align's the message to the right 21 | ``` 22 | 23 | ### Screenshot 24 | 25 | ![chatbot-og](https://user-images.githubusercontent.com/90775147/210397700-5ab9e00d-a61b-4bc9-a34a-b5bd4454b084.png) 26 | 27 | Another example for html in chat, and Refresh chat button 28 | ```py 29 | import streamlit as st 30 | from streamlit_chat import message 31 | from streamlit.components.v1 import html 32 | 33 | def on_input_change(): 34 | user_input = st.session_state.user_input 35 | st.session_state.past.append(user_input) 36 | st.session_state.generated.append("The messages from Bot\nWith new line") 37 | 38 | def on_btn_click(): 39 | del st.session_state.past[:] 40 | del st.session_state.generated[:] 41 | 42 | audio_path = "https://docs.google.com/uc?export=open&id=16QSvoLWNxeqco_Wb2JvzaReSAw5ow6Cl" 43 | img_path = "https://www.groundzeroweb.com/wp-content/uploads/2017/05/Funny-Cat-Memes-11.jpg" 44 | youtube_embed = ''' 45 | 46 | ''' 47 | 48 | markdown = """ 49 | ### HTML in markdown is ~quite~ **unsafe** 50 |
51 | However, if you are in a trusted environment (you trust the markdown). You can use allow_html props to enable support for html. 52 |
53 | 54 | * Lists 55 | * [ ] todo 56 | * [x] done 57 | 58 | Math: 59 | 60 | Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following 61 | equation. 62 | 63 | $$ 64 | L = \\frac{1}{2} \\rho v^2 S C_L 65 | $$ 66 | 67 | ~~~py 68 | import streamlit as st 69 | 70 | st.write("Python code block") 71 | ~~~ 72 | 73 | ~~~js 74 | console.log("Here is some JavaScript code") 75 | ~~~ 76 | 77 | """ 78 | 79 | table_markdown = ''' 80 | A Table: 81 | 82 | | Feature | Support | 83 | | ----------: | :------------------- | 84 | | CommonMark | 100% | 85 | | GFM | 100% w/ `remark-gfm` | 86 | ''' 87 | 88 | st.session_state.setdefault( 89 | 'past', 90 | ['plan text with line break', 91 | 'play the song "Dancing Vegetables"', 92 | 'show me image of cat', 93 | 'and video of it', 94 | 'show me some markdown sample', 95 | 'table in markdown'] 96 | ) 97 | st.session_state.setdefault( 98 | 'generated', 99 | [{'type': 'normal', 'data': 'Line 1 \n Line 2 \n Line 3'}, 100 | {'type': 'normal', 'data': f''}, 101 | {'type': 'normal', 'data': f''}, 102 | {'type': 'normal', 'data': f'{youtube_embed}'}, 103 | {'type': 'normal', 'data': f'{markdown}'}, 104 | {'type': 'table', 'data': f'{table_markdown}'}] 105 | ) 106 | 107 | st.title("Chat placeholder") 108 | 109 | chat_placeholder = st.empty() 110 | 111 | with chat_placeholder.container(): 112 | for i in range(len(st.session_state['generated'])): 113 | message(st.session_state['past'][i], is_user=True, key=f"{i}_user") 114 | message( 115 | st.session_state['generated'][i]['data'], 116 | key=f"{i}", 117 | allow_html=True, 118 | is_table=True if st.session_state['generated'][i]['type']=='table' else False 119 | ) 120 | 121 | st.button("Clear message", on_click=on_btn_click) 122 | 123 | with st.container(): 124 | st.text_input("User Input:", on_change=on_input_change, key="user_input") 125 | 126 | ``` 127 | 128 | ### Screenshot 129 | 130 | ![chatbot-markdown-sp](https://user-images.githubusercontent.com/27276267/224665635-1d9c1b8e-92ba-4f67-9e27-ad5d4eacaa43.png) 131 | 132 | -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | npm i react-markdown rehype-highlight rehype-katex rehype-raw remark-gfm remark-math 4 | -------------------------------------------------------------------------------- /docs/creating-streamlit-component.md: -------------------------------------------------------------------------------- 1 | # Creating a Streamlit Component 2 | 3 | using [react](https://react.dev/) 4 | 5 | ## initiate the frontend 6 | 7 | we will be using [vite](https://vitejs.dev/) for initiating the frontend, as its quite fast compared to create react app[^1] 8 | 9 | ```bash 10 | $ npm create vite@latest 11 | ``` 12 | give the project name as `frontend`, select the framework as react (or any other of your choice) 13 | 14 | ```bash 15 | ? Select a framework: › - Use arrow-keys. Return to submit. 16 | Vanilla 17 | Vue 18 | ❯ React 19 | Preact 20 | Lit 21 | Svelte 22 | Others 23 | ``` 24 | depending on the language you want to use, choose that language variant 25 | ``` 26 | ? Select a variant: › - Use arrow-keys. Return to submit. 27 | TypeScript 28 | ❯ TypeScript + SWC 29 | JavaScript 30 | JavaScript + SWC 31 | ``` 32 | 33 | ## installing necessary packages 34 | 35 | now `cd` into the project directory `cd frontend` and execute 36 | ```bash 37 | $ npm install 38 | ``` 39 | after that, install the `streamlit-component-lib` 40 | 41 | ```bash 42 | $ npm install streamlit-component-lib 43 | ``` 44 | 45 | after executing these commands, edit the :file: `vite.config.ts` to look like 46 | ```ts 47 | import { defineConfig } from 'vite' 48 | import react from '@vitejs/plugin-react-swc' 49 | 50 | // https://vitejs.dev/config/ 51 | export default defineConfig({ 52 | plugins: [react()], 53 | server: { 54 | port: 3001, // to launch the server on port 3001 55 | }, 56 | base: '', // to use absolute url's in the build, might not work without it 57 | }) 58 | ``` 59 | 60 | now using this setup, create your component, to run the development server run the following command 61 | ```bash 62 | $ npm run dev 63 | ``` 64 | to build your component run 65 | ```bash 66 | $ npm run build 67 | ``` 68 | now build the wheel 69 | ```bash 70 | $ python setup.py sdist bdist_wheel 71 | ``` 72 | 73 | and at last upload it to pypi using twine (testpypi) 74 | ```bash 75 | $ python3 -m twine upload --repository testpypi dist/* 76 | ``` 77 | (pypi) 78 | ```bash 79 | $ python3 -m twine upload dist/* 80 | ``` 81 | 82 | [^1]: https://blog.openreplay.com/how-to-build-your-react-app-using-vite/ 83 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | 18 | # Welcome to Streamlit Chat [st-chat] 19 | 20 | Streamlit Component, for a Chat-bot UI, [example app](https://share.streamlit.io/ai-yash/st-chat/main/examples/chatbot.py) 21 | 22 | authors - [@yashppawar](https://github.com/yashppawar) & [@YashVardhan-AI](https://github.com/yashvardhan-ai) 23 | 24 | ## Installation 25 | 26 | Install `streamlit-chat` with pip 27 | ```bash 28 | pip install streamlit-chat 29 | ``` 30 | 31 | usage, import the `message` function from `streamlit_chat` 32 | ```py 33 | import streamlit as st 34 | from streamlit_chat import message 35 | 36 | message("My message") 37 | message("Hello bot!", is_user=True) # align's the message to the right 38 | ``` 39 | 40 | ## Screenshot 41 | 42 | ![chatbot-og](https://user-images.githubusercontent.com/90775147/210397700-5ab9e00d-a61b-4bc9-a34a-b5bd4454b084.png) 43 | -------------------------------------------------------------------------------- /examples/chatbot.py: -------------------------------------------------------------------------------- 1 | import streamlit as st 2 | from streamlit_chat import message 3 | import requests 4 | 5 | st.set_page_config( 6 | page_title="Streamlit Chat - Demo", 7 | page_icon=":robot:" 8 | ) 9 | 10 | API_URL = "https://api-inference.huggingface.co/models/facebook/blenderbot-400M-distill" 11 | headers = {"Authorization": st.secrets['api_key']} 12 | 13 | st.header("Streamlit Chat - Demo") 14 | st.markdown("[Github](https://github.com/ai-yash/st-chat)") 15 | 16 | if 'generated' not in st.session_state: 17 | st.session_state['generated'] = [] 18 | 19 | if 'past' not in st.session_state: 20 | st.session_state['past'] = [] 21 | 22 | def query(payload): 23 | response = requests.post(API_URL, headers=headers, json=payload) 24 | return response.json() 25 | 26 | def get_text(): 27 | input_text = st.text_input("You: ","Hello, how are you?", key="input") 28 | return input_text 29 | 30 | 31 | user_input = get_text() 32 | 33 | if user_input: 34 | output = query({ 35 | "inputs": { 36 | "past_user_inputs": st.session_state.past, 37 | "generated_responses": st.session_state.generated, 38 | "text": user_input, 39 | },"parameters": {"repetition_penalty": 1.33}, 40 | }) 41 | 42 | st.session_state.past.append(user_input) 43 | st.session_state.generated.append(output["generated_text"]) 44 | 45 | if st.session_state['generated']: 46 | 47 | for i in range(len(st.session_state['generated'])-1, -1, -1): 48 | message(st.session_state["generated"][i], key=str(i)) 49 | message(st.session_state['past'][i], is_user=True, key=str(i) + '_user') 50 | 51 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Streamlit Chat 2 | theme: 3 | name: material 4 | 5 | palette: 6 | primary: teal 7 | accent: light blue 8 | scheme: slate 9 | 10 | icon: 11 | repo: fontawesome/brands/github 12 | logo: material/robot 13 | 14 | features: 15 | - navigation.tabs 16 | - navigation.sticky 17 | - navigation.path 18 | 19 | nav: 20 | - Home: index.md 21 | - Create a Component: creating-streamlit-component.md 22 | 23 | repo_url: https://github.com/AI-Yash/st-chat 24 | repo_name: Streamlit Chat 25 | edit_uri: '' 26 | -------------------------------------------------------------------------------- /pip-requirements.txt: -------------------------------------------------------------------------------- 1 | altair==4.1.0 2 | argon2-cffi==21.3.0 3 | argon2-cffi-bindings==21.2.0 4 | astor==0.8.1 5 | attrs==21.2.0 6 | backcall==0.2.0 7 | base58==2.1.1 8 | bleach==4.1.0 9 | blinker==1.4 10 | cachetools==4.2.4 11 | certifi==2020.6.20 12 | cffi==1.15.0 13 | charset-normalizer==2.0.9 14 | click==7.1.2 15 | debugpy==1.5.1 16 | decorator==5.1.0 17 | defusedxml==0.7.1 18 | entrypoints==0.3 19 | gitdb==4.0.9 20 | GitPython==3.1.24 21 | idna==3.3 22 | ipykernel==6.6.0 23 | ipython==7.30.1 24 | ipython-genutils==0.2.0 25 | ipywidgets==7.6.5 26 | jedi==0.18.1 27 | Jinja2==3.0.3 28 | jsonschema==4.3.1 29 | jupyter-client==7.1.0 30 | jupyter-core==4.9.1 31 | jupyterlab-pygments==0.1.2 32 | jupyterlab-widgets==1.0.2 33 | MarkupSafe==2.0.1 34 | matplotlib-inline==0.1.3 35 | mistune==0.8.4 36 | nbclient==0.5.9 37 | nbconvert==6.3.0 38 | nbformat==5.1.3 39 | nest-asyncio==1.5.4 40 | notebook==6.4.6 41 | numpy==1.21.4 42 | packaging==21.3 43 | pandas==1.3.5 44 | pandocfilters==1.5.0 45 | parso==0.8.3 46 | pexpect==4.8.0 47 | pickleshare==0.7.5 48 | Pillow==8.4.0 49 | prometheus-client==0.12.0 50 | prompt-toolkit==3.0.24 51 | protobuf==3.19.1 52 | ptyprocess==0.7.0 53 | pyarrow==6.0.1 54 | pycparser==2.21 55 | pydeck==0.7.1 56 | Pygments==2.10.0 57 | Pympler==1.0 58 | pyparsing==3.0.6 59 | pyrsistent==0.18.0 60 | python-dateutil==2.8.2 61 | pytz==2021.3 62 | pytz-deprecation-shim==0.1.0.post0 63 | pyzmq==22.3.0 64 | requests==2.26.0 65 | Send2Trash==1.8.0 66 | six==1.16.0 67 | smmap==5.0.0 68 | streamlit==1.3.0 69 | terminado==0.12.1 70 | testpath==0.5.0 71 | toml==0.10.2 72 | toolz==0.11.2 73 | tornado==6.1 74 | traitlets==5.1.1 75 | tzdata==2021.5 76 | tzlocal==4.1 77 | urllib3==1.26.7 78 | validators==0.18.2 79 | watchdog==2.1.6 80 | wcwidth==0.2.5 81 | webencodings==0.5.1 82 | widgetsnbextension==3.5.2 83 | -------------------------------------------------------------------------------- /requirements-stc.txt: -------------------------------------------------------------------------------- 1 | fontTools==4.40.0 2 | streamlit==1.10.0 3 | typing_extensions==4.6.3 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | streamlit 2 | streamlit-chat==0.1.0 3 | requests 4 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | with open('README.md') as readme_file: 4 | readme = readme_file.read() 5 | 6 | setuptools.setup( 7 | name="streamlit-chat", 8 | version="0.1.1", 9 | author="Yash Pravin Pawar, Yash Vardhan Kapil", 10 | author_email="yashpawarp@gmail.com", 11 | description="A streamlit component, to make chatbots", 12 | long_description=readme, 13 | long_description_content_type="text/markdown", 14 | url="https://github.com/AI-Yash/st-chat", 15 | packages=setuptools.find_packages(), 16 | include_package_data=True, 17 | classifiers=[ 18 | "Programming Language :: Python :: 3", 19 | "Operating System :: OS Independent", 20 | ], 21 | keywords="chat streamlit streamlit-component", 22 | python_requires=">=3.6", 23 | install_requires=[ 24 | # By definition, a Custom Component depends on Streamlit. 25 | # If your component has other Python dependencies, list 26 | # them here. 27 | "streamlit >= 0.63", 28 | ], 29 | ) 30 | -------------------------------------------------------------------------------- /streamlit_chat/__init__.py: -------------------------------------------------------------------------------- 1 | import streamlit.components.v1 as components 2 | import os 3 | from typing import Optional, Union 4 | 5 | try: 6 | from typing import Literal 7 | except ImportError: 8 | from typing_extensions import Literal 9 | 10 | 11 | _RELEASE = True 12 | COMPONENT_NAME = "streamlit_chat" 13 | NO_AVATAR: str = 'no-avatar' 14 | 15 | # use the build instead of development if release is true 16 | if _RELEASE: 17 | root_dir = os.path.dirname(os.path.abspath(__file__)) 18 | build_dir = os.path.join(root_dir, "frontend/dist") 19 | 20 | _streamlit_chat = components.declare_component( 21 | COMPONENT_NAME, 22 | path = build_dir 23 | ) 24 | else: 25 | _streamlit_chat = components.declare_component( 26 | COMPONENT_NAME, 27 | url = "http://localhost:3001" 28 | ) 29 | 30 | # data type for avatar style 31 | AvatarStyle = Literal[ 32 | "adventurer", 33 | "adventurer-neutral", 34 | "avataaars", 35 | "avataaars-neutral", 36 | "big-ears", 37 | "big-ears-neutral", 38 | "big-smile", 39 | "bottts", 40 | "bottts-neutral", 41 | "croodles", 42 | "croodles-neutral", 43 | "fun-emoji", 44 | "icons", 45 | "identicon", 46 | "initials", 47 | "lorelei", 48 | "lorelei-neutral", 49 | "micah", 50 | "miniavs", 51 | "open-peeps", 52 | "personas", 53 | "pixel-art", 54 | "pixel-art-neutral", 55 | "shapes", 56 | "thumbs", 57 | 'no-avatar', 58 | ] 59 | 60 | def message(message: str, 61 | is_user: Optional[bool] = False, 62 | avatar_style: Optional[AvatarStyle] = None, 63 | logo: Optional[str]=None, 64 | seed: Optional[Union[int, str]] = 88, 65 | key: Optional[str] = None, 66 | allow_html: Optional[bool] = False, 67 | is_table: Optional[bool] = False): 68 | """ 69 | Creates a new instance of streamlit-chat component 70 | 71 | Parameters 72 | ---------- 73 | message: str 74 | The message to be displayed in the component 75 | is_user: bool 76 | if the sender of the message is user, if `True` will align the 77 | message to right, default is False. 78 | avatar_style: Literal or None 79 | The style for the avatar of the sender of message, default is bottts 80 | for not user, and pixel-art-neutral for user. 81 | st-chat uses https://www.dicebear.com/styles for the avatar 82 | logo: Literal or None 83 | The logo to be used if we do not wish Avatars to be used. This is useful 84 | if we want the chatbot to be branded 85 | seed: int or str 86 | The seed for choosing the avatar to be used, default is 42. 87 | allow_html: Boolean 88 | makes it possible to use html in the message, when True, default False 89 | is_table: Boolean 90 | applies specific styling for tables 91 | key: str or None 92 | An optional key that uniquely identifies this component. If this is 93 | None, and the component's arguments are changed, the component will 94 | be re-mounted in the Streamlit frontend and lose its current state. 95 | 96 | Returns: None 97 | """ 98 | 99 | if logo: 100 | _streamlit_chat(message=message, seed=seed, isUser=is_user, logo=logo, key=key, allow_html=allow_html, is_table=is_table) 101 | else: 102 | if not avatar_style: 103 | avatar_style = "fun-emoji" if is_user else "bottts" 104 | _streamlit_chat(message=message, seed=seed, isUser=is_user, avatarStyle=avatar_style, key=key, allow_html=allow_html, is_table=is_table) 105 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { browser: true, es2020: true }, 3 | extends: [ 4 | 'eslint:recommended', 5 | 'plugin:@typescript-eslint/recommended', 6 | 'plugin:react-hooks/recommended', 7 | ], 8 | parser: '@typescript-eslint/parser', 9 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 10 | plugins: ['react-refresh'], 11 | rules: { 12 | 'react-refresh/only-export-components': 'warn', 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "main.js": "./static/js/main.87350243.chunk.js", 4 | "main.js.map": "./static/js/main.87350243.chunk.js.map", 5 | "runtime-main.js": "./static/js/runtime-main.11ec9aca.js", 6 | "runtime-main.js.map": "./static/js/runtime-main.11ec9aca.js.map", 7 | "static/css/2.95a91b17.chunk.css": "./static/css/2.95a91b17.chunk.css", 8 | "static/js/2.e1848dfc.chunk.js": "./static/js/2.e1848dfc.chunk.js", 9 | "static/js/2.e1848dfc.chunk.js.map": "./static/js/2.e1848dfc.chunk.js.map", 10 | "index.html": "./index.html", 11 | "precache-manifest.c29a79fbc77e2c50510d007756686dac.js": "./precache-manifest.c29a79fbc77e2c50510d007756686dac.js", 12 | "service-worker.js": "./service-worker.js", 13 | "static/css/2.95a91b17.chunk.css.map": "./static/css/2.95a91b17.chunk.css.map", 14 | "static/js/2.e1848dfc.chunk.js.LICENSE.txt": "./static/js/2.e1848dfc.chunk.js.LICENSE.txt", 15 | "static/media/katex.min.css": "./static/media/KaTeX_Typewriter-Regular.b8b8393d.woff2" 16 | }, 17 | "entrypoints": [ 18 | "static/js/runtime-main.11ec9aca.js", 19 | "static/css/2.95a91b17.chunk.css", 20 | "static/js/2.e1848dfc.chunk.js", 21 | "static/js/main.87350243.chunk.js" 22 | ] 23 | } -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/index.html: -------------------------------------------------------------------------------- 1 | Streamlit Component
-------------------------------------------------------------------------------- /streamlit_chat/frontend/build/precache-manifest.c29a79fbc77e2c50510d007756686dac.js: -------------------------------------------------------------------------------- 1 | self.__precacheManifest = (self.__precacheManifest || []).concat([ 2 | { 3 | "revision": "f90e630d4222345b49a0c8fe022a0018", 4 | "url": "./index.html" 5 | }, 6 | { 7 | "revision": "33ff99a291cfa94dc21f", 8 | "url": "./static/css/2.95a91b17.chunk.css" 9 | }, 10 | { 11 | "revision": "33ff99a291cfa94dc21f", 12 | "url": "./static/js/2.e1848dfc.chunk.js" 13 | }, 14 | { 15 | "revision": "d448927d184e31601f199ee8b38a43f4", 16 | "url": "./static/js/2.e1848dfc.chunk.js.LICENSE.txt" 17 | }, 18 | { 19 | "revision": "782d01e1e0700ff97aa9", 20 | "url": "./static/js/main.87350243.chunk.js" 21 | }, 22 | { 23 | "revision": "7c26bca7e16783d14d15", 24 | "url": "./static/js/runtime-main.11ec9aca.js" 25 | }, 26 | { 27 | "revision": "10824af77e9961cfd548c8a458f10851", 28 | "url": "./static/media/KaTeX_AMS-Regular.10824af7.woff" 29 | }, 30 | { 31 | "revision": "56573229753fad48910bda2ea1a6dd54", 32 | "url": "./static/media/KaTeX_AMS-Regular.56573229.ttf" 33 | }, 34 | { 35 | "revision": "66c678209ce93b6e2b583f02ce41529e", 36 | "url": "./static/media/KaTeX_AMS-Regular.66c67820.woff2" 37 | }, 38 | { 39 | "revision": "497bf407c4c609c6cf1f1ad38f437f7f", 40 | "url": "./static/media/KaTeX_Caligraphic-Bold.497bf407.ttf" 41 | }, 42 | { 43 | "revision": "a9e9b0953b078cd40f5e19ef4face6fc", 44 | "url": "./static/media/KaTeX_Caligraphic-Bold.a9e9b095.woff2" 45 | }, 46 | { 47 | "revision": "de2ba279933d60f7819ff61f71c17bed", 48 | "url": "./static/media/KaTeX_Caligraphic-Bold.de2ba279.woff" 49 | }, 50 | { 51 | "revision": "08d95d99bf4a2b2dc7a876653857f154", 52 | "url": "./static/media/KaTeX_Caligraphic-Regular.08d95d99.woff2" 53 | }, 54 | { 55 | "revision": "a25140fbe6692bffe71a2ab861572eb3", 56 | "url": "./static/media/KaTeX_Caligraphic-Regular.a25140fb.woff" 57 | }, 58 | { 59 | "revision": "e6fb499fc8f9925eea3138cccba17fff", 60 | "url": "./static/media/KaTeX_Caligraphic-Regular.e6fb499f.ttf" 61 | }, 62 | { 63 | "revision": "40934fc076960bb989d590db044fef62", 64 | "url": "./static/media/KaTeX_Fraktur-Bold.40934fc0.woff" 65 | }, 66 | { 67 | "revision": "796f3797cdf36fcaea18c3070a608378", 68 | "url": "./static/media/KaTeX_Fraktur-Bold.796f3797.woff2" 69 | }, 70 | { 71 | "revision": "b9d7c4497cab3702487214651ab03744", 72 | "url": "./static/media/KaTeX_Fraktur-Bold.b9d7c449.ttf" 73 | }, 74 | { 75 | "revision": "97a699d83318e9334a0deaea6ae5eda2", 76 | "url": "./static/media/KaTeX_Fraktur-Regular.97a699d8.ttf" 77 | }, 78 | { 79 | "revision": "e435cda5784e21b26ab2d03fbcb56a99", 80 | "url": "./static/media/KaTeX_Fraktur-Regular.e435cda5.woff" 81 | }, 82 | { 83 | "revision": "f9e6a99f4a543b7d6cad1efb6cf1e4b1", 84 | "url": "./static/media/KaTeX_Fraktur-Regular.f9e6a99f.woff2" 85 | }, 86 | { 87 | "revision": "4cdba6465ab9fac5d3833c6cdba7a8c3", 88 | "url": "./static/media/KaTeX_Main-Bold.4cdba646.woff" 89 | }, 90 | { 91 | "revision": "8e431f7ece346b6282dae3d9d0e7a970", 92 | "url": "./static/media/KaTeX_Main-Bold.8e431f7e.ttf" 93 | }, 94 | { 95 | "revision": "a9382e25bcf75d856718fcef54d7acdb", 96 | "url": "./static/media/KaTeX_Main-Bold.a9382e25.woff2" 97 | }, 98 | { 99 | "revision": "52fb39b0434c463d5df32419608ab08a", 100 | "url": "./static/media/KaTeX_Main-BoldItalic.52fb39b0.ttf" 101 | }, 102 | { 103 | "revision": "5f875f986a9bce1264e8c42417b56f74", 104 | "url": "./static/media/KaTeX_Main-BoldItalic.5f875f98.woff" 105 | }, 106 | { 107 | "revision": "d873734390c716d6e18ff3f71ac6eb8b", 108 | "url": "./static/media/KaTeX_Main-BoldItalic.d8737343.woff2" 109 | }, 110 | { 111 | "revision": "39349e0a2b366f38e2672b45aded2030", 112 | "url": "./static/media/KaTeX_Main-Italic.39349e0a.ttf" 113 | }, 114 | { 115 | "revision": "652970624cde999882102fa2b6a8871f", 116 | "url": "./static/media/KaTeX_Main-Italic.65297062.woff2" 117 | }, 118 | { 119 | "revision": "8ffd28f6390231548ead99d7835887fa", 120 | "url": "./static/media/KaTeX_Main-Italic.8ffd28f6.woff" 121 | }, 122 | { 123 | "revision": "818582dae57e6fac46202cfd844afabb", 124 | "url": "./static/media/KaTeX_Main-Regular.818582da.ttf" 125 | }, 126 | { 127 | "revision": "f1cdb692ee31c10b37262caffced5271", 128 | "url": "./static/media/KaTeX_Main-Regular.f1cdb692.woff" 129 | }, 130 | { 131 | "revision": "f8a7f19f45060f7a177314855b8c7aa3", 132 | "url": "./static/media/KaTeX_Main-Regular.f8a7f19f.woff2" 133 | }, 134 | { 135 | "revision": "1320454d951ec809a7dbccb4f23fccf0", 136 | "url": "./static/media/KaTeX_Math-BoldItalic.1320454d.woff2" 137 | }, 138 | { 139 | "revision": "48155e43d9a284b54753e50e4ba586dc", 140 | "url": "./static/media/KaTeX_Math-BoldItalic.48155e43.woff" 141 | }, 142 | { 143 | "revision": "6589c4f1f587f73f0ad0af8ae35ccb53", 144 | "url": "./static/media/KaTeX_Math-BoldItalic.6589c4f1.ttf" 145 | }, 146 | { 147 | "revision": "d8b7a801bd87b324efcbae7394119c24", 148 | "url": "./static/media/KaTeX_Math-Italic.d8b7a801.woff2" 149 | }, 150 | { 151 | "revision": "ed7aea12d765f9e2d0f9bc7fa2be626c", 152 | "url": "./static/media/KaTeX_Math-Italic.ed7aea12.woff" 153 | }, 154 | { 155 | "revision": "fe5ed5875d95b18c98546cb4f47304ff", 156 | "url": "./static/media/KaTeX_Math-Italic.fe5ed587.ttf" 157 | }, 158 | { 159 | "revision": "0e897d27f063facef504667290e408bd", 160 | "url": "./static/media/KaTeX_SansSerif-Bold.0e897d27.woff" 161 | }, 162 | { 163 | "revision": "ad546b4719bcf690a3604944b90b7e42", 164 | "url": "./static/media/KaTeX_SansSerif-Bold.ad546b47.woff2" 165 | }, 166 | { 167 | "revision": "f2ac73121357210d91e5c3eaa42f72ea", 168 | "url": "./static/media/KaTeX_SansSerif-Bold.f2ac7312.ttf" 169 | }, 170 | { 171 | "revision": "e934cbc86e2d59ceaf04102c43dc0b50", 172 | "url": "./static/media/KaTeX_SansSerif-Italic.e934cbc8.woff2" 173 | }, 174 | { 175 | "revision": "ef725de572b71381dccf53918e300744", 176 | "url": "./static/media/KaTeX_SansSerif-Italic.ef725de5.woff" 177 | }, 178 | { 179 | "revision": "f60b4a34842bb524b562df092917a542", 180 | "url": "./static/media/KaTeX_SansSerif-Italic.f60b4a34.ttf" 181 | }, 182 | { 183 | "revision": "1ac3ed6ebe34e473519ca1da86f7a384", 184 | "url": "./static/media/KaTeX_SansSerif-Regular.1ac3ed6e.woff2" 185 | }, 186 | { 187 | "revision": "3243452ee6817acd761c9757aef93c29", 188 | "url": "./static/media/KaTeX_SansSerif-Regular.3243452e.ttf" 189 | }, 190 | { 191 | "revision": "5f8637ee731482c44a37789723f5e499", 192 | "url": "./static/media/KaTeX_SansSerif-Regular.5f8637ee.woff" 193 | }, 194 | { 195 | "revision": "1b3161eb8cc67462d6e8c2fb96c68507", 196 | "url": "./static/media/KaTeX_Script-Regular.1b3161eb.woff2" 197 | }, 198 | { 199 | "revision": "a189c37d73ffce63464635dc12cbbc96", 200 | "url": "./static/media/KaTeX_Script-Regular.a189c37d.ttf" 201 | }, 202 | { 203 | "revision": "a82fa2a7e18b8c7a1a9f6069844ebfb9", 204 | "url": "./static/media/KaTeX_Script-Regular.a82fa2a7.woff" 205 | }, 206 | { 207 | "revision": "0d8d9204004bdf126342605f7bbdffe6", 208 | "url": "./static/media/KaTeX_Size1-Regular.0d8d9204.ttf" 209 | }, 210 | { 211 | "revision": "4788ba5b6247e336f734b742fe9900d5", 212 | "url": "./static/media/KaTeX_Size1-Regular.4788ba5b.woff" 213 | }, 214 | { 215 | "revision": "82ef26dc680ba60d884e051c73d9a42d", 216 | "url": "./static/media/KaTeX_Size1-Regular.82ef26dc.woff2" 217 | }, 218 | { 219 | "revision": "1fdda0e59ed35495ebac28badf210574", 220 | "url": "./static/media/KaTeX_Size2-Regular.1fdda0e5.ttf" 221 | }, 222 | { 223 | "revision": "95a1da914c20455a07b7c9e2dcf2836d", 224 | "url": "./static/media/KaTeX_Size2-Regular.95a1da91.woff2" 225 | }, 226 | { 227 | "revision": "b0628bfd27c979a09f702a2277979888", 228 | "url": "./static/media/KaTeX_Size2-Regular.b0628bfd.woff" 229 | }, 230 | { 231 | "revision": "4de844d4552e941f6b9c38837a8d487b", 232 | "url": "./static/media/KaTeX_Size3-Regular.4de844d4.woff" 233 | }, 234 | { 235 | "revision": "9108a400f4787cffdcc3a3b813401e6a", 236 | "url": "./static/media/KaTeX_Size3-Regular.9108a400.woff2" 237 | }, 238 | { 239 | "revision": "963af864cbb10611ba33267ba7953777", 240 | "url": "./static/media/KaTeX_Size3-Regular.963af864.ttf" 241 | }, 242 | { 243 | "revision": "27a23ee69999affa55491c7dab8e53bf", 244 | "url": "./static/media/KaTeX_Size4-Regular.27a23ee6.ttf" 245 | }, 246 | { 247 | "revision": "3045a61f722bc4b198450ce69b3e3824", 248 | "url": "./static/media/KaTeX_Size4-Regular.3045a61f.woff" 249 | }, 250 | { 251 | "revision": "61522cd3d9043622e235ab57762754f2", 252 | "url": "./static/media/KaTeX_Size4-Regular.61522cd3.woff2" 253 | }, 254 | { 255 | "revision": "0e0460587676d22eae09accd6dcfebc6", 256 | "url": "./static/media/KaTeX_Typewriter-Regular.0e046058.woff" 257 | }, 258 | { 259 | "revision": "6bf4287568e1d3004b54d5d60f9f08f9", 260 | "url": "./static/media/KaTeX_Typewriter-Regular.6bf42875.ttf" 261 | }, 262 | { 263 | "revision": "b8b8393d2e65fcebda5fa99fa3264f41", 264 | "url": "./static/media/KaTeX_Typewriter-Regular.b8b8393d.woff2" 265 | } 266 | ]); -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Welcome to your Workbox-powered service worker! 3 | * 4 | * You'll need to register this file in your web app and you should 5 | * disable HTTP caching for this file too. 6 | * See https://goo.gl/nhQhGp 7 | * 8 | * The rest of the code is auto-generated. Please don't update this file 9 | * directly; instead, make changes to your Workbox build configuration 10 | * and re-run your build process. 11 | * See https://goo.gl/2aRDsh 12 | */ 13 | 14 | importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); 15 | 16 | importScripts( 17 | "./precache-manifest.c29a79fbc77e2c50510d007756686dac.js" 18 | ); 19 | 20 | self.addEventListener('message', (event) => { 21 | if (event.data && event.data.type === 'SKIP_WAITING') { 22 | self.skipWaiting(); 23 | } 24 | }); 25 | 26 | workbox.core.clientsClaim(); 27 | 28 | /** 29 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to 30 | * requests for URLs in the manifest. 31 | * See https://goo.gl/S9QRab 32 | */ 33 | self.__precacheManifest = [].concat(self.__precacheManifest || []); 34 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 35 | 36 | workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("./index.html"), { 37 | 38 | blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], 39 | }); 40 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/css/2.95a91b17.chunk.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_AMS-Regular.66c67820.woff2) format("woff2"),url(../../static/media/KaTeX_AMS-Regular.10824af7.woff) format("woff"),url(../../static/media/KaTeX_AMS-Regular.56573229.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Caligraphic-Bold.a9e9b095.woff2) format("woff2"),url(../../static/media/KaTeX_Caligraphic-Bold.de2ba279.woff) format("woff"),url(../../static/media/KaTeX_Caligraphic-Bold.497bf407.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Caligraphic-Regular.08d95d99.woff2) format("woff2"),url(../../static/media/KaTeX_Caligraphic-Regular.a25140fb.woff) format("woff"),url(../../static/media/KaTeX_Caligraphic-Regular.e6fb499f.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Fraktur-Bold.796f3797.woff2) format("woff2"),url(../../static/media/KaTeX_Fraktur-Bold.40934fc0.woff) format("woff"),url(../../static/media/KaTeX_Fraktur-Bold.b9d7c449.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Fraktur-Regular.f9e6a99f.woff2) format("woff2"),url(../../static/media/KaTeX_Fraktur-Regular.e435cda5.woff) format("woff"),url(../../static/media/KaTeX_Fraktur-Regular.97a699d8.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Main-Bold.a9382e25.woff2) format("woff2"),url(../../static/media/KaTeX_Main-Bold.4cdba646.woff) format("woff"),url(../../static/media/KaTeX_Main-Bold.8e431f7e.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Main-BoldItalic.d8737343.woff2) format("woff2"),url(../../static/media/KaTeX_Main-BoldItalic.5f875f98.woff) format("woff"),url(../../static/media/KaTeX_Main-BoldItalic.52fb39b0.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Main-Italic.65297062.woff2) format("woff2"),url(../../static/media/KaTeX_Main-Italic.8ffd28f6.woff) format("woff"),url(../../static/media/KaTeX_Main-Italic.39349e0a.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Main-Regular.f8a7f19f.woff2) format("woff2"),url(../../static/media/KaTeX_Main-Regular.f1cdb692.woff) format("woff"),url(../../static/media/KaTeX_Main-Regular.818582da.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Math-BoldItalic.1320454d.woff2) format("woff2"),url(../../static/media/KaTeX_Math-BoldItalic.48155e43.woff) format("woff"),url(../../static/media/KaTeX_Math-BoldItalic.6589c4f1.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Math-Italic.d8b7a801.woff2) format("woff2"),url(../../static/media/KaTeX_Math-Italic.ed7aea12.woff) format("woff"),url(../../static/media/KaTeX_Math-Italic.fe5ed587.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_SansSerif-Bold.ad546b47.woff2) format("woff2"),url(../../static/media/KaTeX_SansSerif-Bold.0e897d27.woff) format("woff"),url(../../static/media/KaTeX_SansSerif-Bold.f2ac7312.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Italic.e934cbc8.woff2) format("woff2"),url(../../static/media/KaTeX_SansSerif-Italic.ef725de5.woff) format("woff"),url(../../static/media/KaTeX_SansSerif-Italic.f60b4a34.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Regular.1ac3ed6e.woff2) format("woff2"),url(../../static/media/KaTeX_SansSerif-Regular.5f8637ee.woff) format("woff"),url(../../static/media/KaTeX_SansSerif-Regular.3243452e.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Script-Regular.1b3161eb.woff2) format("woff2"),url(../../static/media/KaTeX_Script-Regular.a82fa2a7.woff) format("woff"),url(../../static/media/KaTeX_Script-Regular.a189c37d.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size1-Regular.82ef26dc.woff2) format("woff2"),url(../../static/media/KaTeX_Size1-Regular.4788ba5b.woff) format("woff"),url(../../static/media/KaTeX_Size1-Regular.0d8d9204.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size2-Regular.95a1da91.woff2) format("woff2"),url(../../static/media/KaTeX_Size2-Regular.b0628bfd.woff) format("woff"),url(../../static/media/KaTeX_Size2-Regular.1fdda0e5.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size3-Regular.9108a400.woff2) format("woff2"),url(../../static/media/KaTeX_Size3-Regular.4de844d4.woff) format("woff"),url(../../static/media/KaTeX_Size3-Regular.963af864.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size4-Regular.61522cd3.woff2) format("woff2"),url(../../static/media/KaTeX_Size4-Regular.3045a61f.woff) format("woff"),url(../../static/media/KaTeX_Size4-Regular.27a23ee6.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Typewriter-Regular.b8b8393d.woff2) format("woff2"),url(../../static/media/KaTeX_Typewriter-Regular.0e046058.woff) format("woff"),url(../../static/media/KaTeX_Typewriter-Regular.6bf42875.ttf) format("truetype")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.15.6"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#23241f}.hljs,.hljs-subst,.hljs-tag{color:#f8f8f2}.hljs-emphasis,.hljs-strong{color:#a8a8a2}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:#ae81ff}.hljs-code,.hljs-section,.hljs-selector-class,.hljs-title{color:#a6e22e}.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic}.hljs-attr,.hljs-keyword,.hljs-name,.hljs-selector-tag{color:#f92672}.hljs-attribute,.hljs-symbol{color:#66d9ef}.hljs-class .hljs-title,.hljs-params,.hljs-title.class_{color:#f8f8f2}.hljs-addition,.hljs-built_in,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-string,.hljs-template-variable,.hljs-type,.hljs-variable{color:#e6db74}.hljs-comment,.hljs-deletion,.hljs-meta{color:#75715e} 2 | /*# sourceMappingURL=2.95a91b17.chunk.css.map */ -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/css/2.95a91b17.chunk.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["katex.min.css","monokai-sublime.css"],"names":[],"mappings":"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","file":"2.95a91b17.chunk.css","sourcesContent":["@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_AMS-Regular.woff) format(\"woff\"),url(fonts/KaTeX_AMS-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format(\"woff2\"),url(fonts/KaTeX_Caligraphic-Bold.woff) format(\"woff\"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Caligraphic-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format(\"woff2\"),url(fonts/KaTeX_Fraktur-Bold.woff) format(\"woff\"),url(fonts/KaTeX_Fraktur-Bold.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Fraktur-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Fraktur-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format(\"woff2\"),url(fonts/KaTeX_Main-Bold.woff) format(\"woff\"),url(fonts/KaTeX_Main-Bold.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format(\"woff2\"),url(fonts/KaTeX_Main-BoldItalic.woff) format(\"woff\"),url(fonts/KaTeX_Main-BoldItalic.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format(\"woff2\"),url(fonts/KaTeX_Main-Italic.woff) format(\"woff\"),url(fonts/KaTeX_Main-Italic.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Main-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Main-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format(\"woff2\"),url(fonts/KaTeX_Math-BoldItalic.woff) format(\"woff\"),url(fonts/KaTeX_Math-BoldItalic.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format(\"woff2\"),url(fonts/KaTeX_Math-Italic.woff) format(\"woff\"),url(fonts/KaTeX_Math-Italic.ttf) format(\"truetype\")}@font-face{font-family:\"KaTeX_SansSerif\";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format(\"woff2\"),url(fonts/KaTeX_SansSerif-Bold.woff) format(\"woff\"),url(fonts/KaTeX_SansSerif-Bold.ttf) format(\"truetype\")}@font-face{font-family:\"KaTeX_SansSerif\";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format(\"woff2\"),url(fonts/KaTeX_SansSerif-Italic.woff) format(\"woff\"),url(fonts/KaTeX_SansSerif-Italic.ttf) format(\"truetype\")}@font-face{font-family:\"KaTeX_SansSerif\";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_SansSerif-Regular.woff) format(\"woff\"),url(fonts/KaTeX_SansSerif-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Script-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Script-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Size1-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Size1-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Size2-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Size2-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Size3-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Size3-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Size4-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Size4-Regular.ttf) format(\"truetype\")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format(\"woff2\"),url(fonts/KaTeX_Typewriter-Regular.woff) format(\"woff\"),url(fonts/KaTeX_Typewriter-Regular.ttf) format(\"truetype\")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:\"0.15.6\"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:\"\"}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:\"(\" counter(katexEqnNo) \")\";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:\"(\" counter(mmlEqnNo) \")\";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}\n","pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#23241f;color:#f8f8f2}.hljs-subst,.hljs-tag{color:#f8f8f2}.hljs-emphasis,.hljs-strong{color:#a8a8a2}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:#ae81ff}.hljs-code,.hljs-section,.hljs-selector-class,.hljs-title{color:#a6e22e}.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic}.hljs-attr,.hljs-keyword,.hljs-name,.hljs-selector-tag{color:#f92672}.hljs-attribute,.hljs-symbol{color:#66d9ef}.hljs-class .hljs-title,.hljs-params,.hljs-title.class_{color:#f8f8f2}.hljs-addition,.hljs-built_in,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-string,.hljs-template-variable,.hljs-type,.hljs-variable{color:#e6db74}.hljs-comment,.hljs-deletion,.hljs-meta{color:#75715e}"]} -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/js/2.e1848dfc.chunk.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | object-assign 3 | (c) Sindre Sorhus 4 | @license MIT 5 | */ 6 | 7 | /*! 8 | * Determine if an object is a Buffer 9 | * 10 | * @author Feross Aboukhadijeh 11 | * @license MIT 12 | */ 13 | 14 | /** 15 | * @license 16 | * Copyright 2018-2021 Streamlit Inc. 17 | * 18 | * Licensed under the Apache License, Version 2.0 (the "License"); 19 | * you may not use this file except in compliance with the License. 20 | * You may obtain a copy of the License at 21 | * 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * 24 | * Unless required by applicable law or agreed to in writing, software 25 | * distributed under the License is distributed on an "AS IS" BASIS, 26 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 27 | * See the License for the specific language governing permissions and 28 | * limitations under the License. 29 | */ 30 | 31 | /** 32 | * @license React 33 | * react-is.production.min.js 34 | * 35 | * Copyright (c) Facebook, Inc. and its affiliates. 36 | * 37 | * This source code is licensed under the MIT license found in the 38 | * LICENSE file in the root directory of this source tree. 39 | */ 40 | 41 | /** @license React v0.19.1 42 | * scheduler.production.min.js 43 | * 44 | * Copyright (c) Facebook, Inc. and its affiliates. 45 | * 46 | * This source code is licensed under the MIT license found in the 47 | * LICENSE file in the root directory of this source tree. 48 | */ 49 | 50 | /** @license React v16.13.1 51 | * react-is.production.min.js 52 | * 53 | * Copyright (c) Facebook, Inc. and its affiliates. 54 | * 55 | * This source code is licensed under the MIT license found in the 56 | * LICENSE file in the root directory of this source tree. 57 | */ 58 | 59 | /** @license React v16.14.0 60 | * react-dom.production.min.js 61 | * 62 | * Copyright (c) Facebook, Inc. and its affiliates. 63 | * 64 | * This source code is licensed under the MIT license found in the 65 | * LICENSE file in the root directory of this source tree. 66 | */ 67 | 68 | /** @license React v16.14.0 69 | * react.production.min.js 70 | * 71 | * Copyright (c) Facebook, Inc. and its affiliates. 72 | * 73 | * This source code is licensed under the MIT license found in the 74 | * LICENSE file in the root directory of this source tree. 75 | */ 76 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/js/main.87350243.chunk.js: -------------------------------------------------------------------------------- 1 | (this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{153:function(e,t,a){e.exports=a(208)},208:function(e,t,a){"use strict";a.r(t);var r,n,i=a(10),c=a.n(i),o=a(99),l=a.n(o),s=a(7),d=a(81),p=a(0),m=a(1),u=a(2),b=a(3),g=a(68),h=a(69),f=a(50),v=a(244),x=a(145),j=a(147),O=a(146),w=a(144),y=a(247),E=(a(161),a(162),function(e){Object(u.a)(a,e);var t=Object(b.a)(a);function a(){var e;Object(m.a)(this,a);for(var i=arguments.length,o=new Array(i),l=0;l div {\n text-align: right;\n }\n "]))):Object(f.a)(n||(n=Object(d.a)([""])))})),S=[x.a,w.a],U=[j.a].concat(Object(s.a)(p?[O.a]:[]));return c.a.createElement(_,{isUser:a},c.a.createElement(E,{src:u,alt:"profile",draggable:"false"}),c.a.createElement(k,null,c.a.createElement(v.a,{remarkPlugins:S,rehypePlugins:[].concat(Object(s.a)(U),[[y.a,{detect:!0}]])},l)))},e}return Object(p.a)(a)}(g.b)),k=Object(g.c)(E);l.a.render(c.a.createElement(c.a.StrictMode,null,c.a.createElement(k,null)),document.getElementById("root"))}},[[153,1,2]]]); 2 | //# sourceMappingURL=main.87350243.chunk.js.map -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/js/main.87350243.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["stChat.tsx","index.tsx"],"names":["Chat","render","Streamlit","setFrameHeight","window","innerHeight","props","args","isUser","avatarStyle","seed","message","allow_html","is_table","avatarUrl","theme","Avatar","styled","img","border","borderRadius","height","width","margin","Message","div","display","background","secondaryBackgroundColor","padding","maxWidth","whiteSpace","fontFamily","font","css","remarkPlugins","remarkMath","remarkGfm","rehypePlugins","rehypeKatex","rehypeRaw","src","alt","draggable","rehypeHighlight","detect","StreamlitComponentBase","withStreamlitConnection","ReactDOM","StrictMode","document","getElementById"],"mappings":"8VAuBMA,G,0NACGC,OAAS,WACdC,IAAUC,eAAeC,OAAOC,aAChC,MAAqE,EAAKC,MAAMC,KAAxEC,EAAR,EAAQA,OAAQC,EAAhB,EAAgBA,YAAaC,EAA7B,EAA6BA,KAAMC,EAAnC,EAAmCA,QAASC,EAA5C,EAA4CA,WAAYC,EAAxD,EAAwDA,SAClDC,EAAS,uCAAmCL,EAAnC,qBAA2DC,GAKlEK,EAAU,EAAKT,MAAfS,MAIR,IAAKA,EACH,OAAO,oFAIT,IAAMC,EAASC,IAAOC,IAAI,CACxBC,OAAO,wBACPC,aAAc,MACdC,OAAQ,OACRC,MAAO,OACPC,OAAQ,IAIJC,EAAUP,IAAOQ,IAAI,CACzBC,QAAS,eACTC,WAAYZ,EAAMa,yBAClBT,OAAQ,wBACRC,aAAc,OACdS,QAAS,YACTN,OAAQ,WACRO,SAAU,MACVC,WAAalB,EAAwB,SAAb,aAIpBb,EAAOiB,IAAOQ,IAAI,CACtBC,QAAS,OAETM,WAAW,GAAD,OAAKjB,EAAMkB,KAAX,sCACVZ,OAAQ,OACRE,OAAQ,EACRD,MAAO,SAET,SAAChB,GACC,OAAIA,EAAME,OACD0B,YAAP,8IAOKA,YAAP,6BAIIC,EAAgB,CACpBC,IACAC,KAEIC,EAAa,CACjBC,KADiB,mBAEb3B,EAAa,CAAC4B,KAAa,KAGjC,OACE,kBAAC,EAAD,CAAMhC,OAAQA,GACZ,kBAACQ,EAAD,CAAQyB,IAAK3B,EAAW4B,IAAI,UAAUC,UAAU,UAChD,kBAACnB,EAAD,KACE,kBAAC,IAAD,CACEW,cAAeA,EACfG,cAAa,sBAAMA,GAAN,CAAqB,CAACM,IAAiB,CAACC,QAAQ,OAE5DlC,M,yBA7EMmC,MAqFJC,cAAwB/C,GCxGvCgD,IAAS/C,OACP,kBAAC,IAAMgD,WAAP,KACE,kBAAC,EAAD,OAEFC,SAASC,eAAe,W","file":"static/js/main.87350243.chunk.js","sourcesContent":["import {\r\n // eslint-disable-next-line \r\n Streamlit,\r\n StreamlitComponentBase,\r\n withStreamlitConnection,\r\n} from \"streamlit-component-lib\"\r\nimport React, { ReactNode } from \"react\"\r\nimport styled from '@emotion/styled'\r\nimport { css } from '@emotion/react'\r\n\r\nimport ReactMarkdown from \"react-markdown\"\r\nimport remarkMath from \"remark-math\"\r\nimport rehypeKatex from \"rehype-katex\"\r\nimport rehypeRaw from \"rehype-raw\"\r\nimport remarkGfm from \"remark-gfm\"\r\nimport rehypeHighlight from \"rehype-highlight\"\r\n\r\nimport 'katex/dist/katex.min.css'\r\nimport 'highlight.js/styles/monokai-sublime.css'\r\n\r\n// import ReactHtmlParser from 'react-html-parser'\r\n\r\n\r\nclass Chat extends StreamlitComponentBase {\r\n public render = (): ReactNode => {\r\n Streamlit.setFrameHeight(window.innerHeight)\r\n const { isUser, avatarStyle, seed, message, allow_html, is_table } = this.props.args;\r\n const avatarUrl = `https://api.dicebear.com/5.x/${avatarStyle}/svg?seed=${seed}`\r\n \r\n // Streamlit sends us a theme object via props that we can use to ensure\r\n // that our component has visuals that match the active theme in a\r\n // streamlit app.\r\n const { theme } = this.props\r\n \r\n // Maintain compatibility with older versions of Streamlit that don't send\r\n // a theme object.\r\n if (!theme) {\r\n return
Theme is undefined, please check streamlit version.
\r\n }\r\n \r\n // styles for the avatar image\r\n const Avatar = styled.img({\r\n border: `1px solid transparent`,\r\n borderRadius: '50%',\r\n height: '3rem',\r\n width: '3rem',\r\n margin: 0\r\n })\r\n \r\n // styles for the message box\r\n const Message = styled.div({\r\n display: 'inline-block',\r\n background: theme.secondaryBackgroundColor,\r\n border: '1px solid transparent',\r\n borderRadius: '10px',\r\n padding: '10px 14px',\r\n margin: '5px 20px',\r\n maxWidth: '70%',\r\n whiteSpace: !is_table ? 'pre-line' : 'normal'\r\n })\r\n \r\n // styles for the container\r\n const Chat = styled.div({\r\n display: 'flex',\r\n // flexDirection: 'row',\r\n fontFamily: `${theme.font}, 'Segoe UI', 'Roboto', sans-serif`, \r\n height: 'auto',\r\n margin: 0,\r\n width: '100%'\r\n }, \r\n (props: {isUser: boolean}) => { // specific styles\r\n if (props.isUser){\r\n return css`\r\n flex-direction: row-reverse;\r\n & > div {\r\n text-align: right;\r\n }\r\n `\r\n }\r\n return css``\r\n })\r\n\r\n // Init React Markdown plugins\r\n const remarkPlugins = [\r\n remarkMath, \r\n remarkGfm\r\n ]\r\n const rehypePlugins = [\r\n rehypeKatex,\r\n ...(allow_html ? [rehypeRaw] : [])\r\n ]\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {message}\r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n\r\nexport default withStreamlitConnection(Chat);\r\n","import React from \"react\"\r\nimport ReactDOM from \"react-dom\"\r\nimport Chat from \"./stChat\"\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById(\"root\")\r\n)\r\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_AMS-Regular.10824af7.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_AMS-Regular.10824af7.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_AMS-Regular.56573229.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_AMS-Regular.56573229.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_AMS-Regular.66c67820.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_AMS-Regular.66c67820.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Bold.497bf407.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Bold.497bf407.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Bold.a9e9b095.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Bold.a9e9b095.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Bold.de2ba279.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Bold.de2ba279.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Regular.08d95d99.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Regular.08d95d99.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Regular.a25140fb.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Regular.a25140fb.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Regular.e6fb499f.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Caligraphic-Regular.e6fb499f.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Bold.40934fc0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Bold.40934fc0.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Bold.796f3797.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Bold.796f3797.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Bold.b9d7c449.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Bold.b9d7c449.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Regular.97a699d8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Regular.97a699d8.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Regular.e435cda5.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Regular.e435cda5.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Regular.f9e6a99f.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Fraktur-Regular.f9e6a99f.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Bold.4cdba646.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Bold.4cdba646.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Bold.8e431f7e.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Bold.8e431f7e.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Bold.a9382e25.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Bold.a9382e25.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-BoldItalic.52fb39b0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-BoldItalic.52fb39b0.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-BoldItalic.5f875f98.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-BoldItalic.5f875f98.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-BoldItalic.d8737343.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-BoldItalic.d8737343.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Italic.39349e0a.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Italic.39349e0a.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Italic.65297062.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Italic.65297062.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Italic.8ffd28f6.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Italic.8ffd28f6.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Regular.818582da.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Regular.818582da.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Regular.f1cdb692.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Regular.f1cdb692.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Main-Regular.f8a7f19f.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Main-Regular.f8a7f19f.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Math-BoldItalic.1320454d.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Math-BoldItalic.1320454d.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Math-BoldItalic.48155e43.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Math-BoldItalic.48155e43.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Math-BoldItalic.6589c4f1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Math-BoldItalic.6589c4f1.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Math-Italic.d8b7a801.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Math-Italic.d8b7a801.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Math-Italic.ed7aea12.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Math-Italic.ed7aea12.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Math-Italic.fe5ed587.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Math-Italic.fe5ed587.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Bold.0e897d27.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Bold.0e897d27.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Bold.ad546b47.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Bold.ad546b47.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Bold.f2ac7312.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Bold.f2ac7312.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Italic.e934cbc8.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Italic.e934cbc8.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Italic.ef725de5.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Italic.ef725de5.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Italic.f60b4a34.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Italic.f60b4a34.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Regular.1ac3ed6e.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Regular.1ac3ed6e.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Regular.3243452e.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Regular.3243452e.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Regular.5f8637ee.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_SansSerif-Regular.5f8637ee.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Script-Regular.1b3161eb.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Script-Regular.1b3161eb.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Script-Regular.a189c37d.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Script-Regular.a189c37d.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Script-Regular.a82fa2a7.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Script-Regular.a82fa2a7.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size1-Regular.0d8d9204.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size1-Regular.0d8d9204.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size1-Regular.4788ba5b.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size1-Regular.4788ba5b.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size1-Regular.82ef26dc.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size1-Regular.82ef26dc.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size2-Regular.1fdda0e5.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size2-Regular.1fdda0e5.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size2-Regular.95a1da91.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size2-Regular.95a1da91.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size2-Regular.b0628bfd.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size2-Regular.b0628bfd.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size3-Regular.4de844d4.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size3-Regular.4de844d4.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size3-Regular.9108a400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size3-Regular.9108a400.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size3-Regular.963af864.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size3-Regular.963af864.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size4-Regular.27a23ee6.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size4-Regular.27a23ee6.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size4-Regular.3045a61f.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size4-Regular.3045a61f.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Size4-Regular.61522cd3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Size4-Regular.61522cd3.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Typewriter-Regular.0e046058.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Typewriter-Regular.0e046058.woff -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Typewriter-Regular.6bf42875.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Typewriter-Regular.6bf42875.ttf -------------------------------------------------------------------------------- /streamlit_chat/frontend/build/static/media/KaTeX_Typewriter-Regular.b8b8393d.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AI-Yash/st-chat/0f647f32dad43ff631a92aac87d8a17b5cb75824/streamlit_chat/frontend/build/static/media/KaTeX_Typewriter-Regular.b8b8393d.woff2 -------------------------------------------------------------------------------- /streamlit_chat/frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Streamlit Chat Component 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "private": true, 4 | "version": "0.1.1", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "tsc && vite build", 9 | "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0", 15 | "react-markdown": "^8.0.7", 16 | "rehype-highlight": "^6.0.0", 17 | "rehype-katex": "^6.0.3", 18 | "rehype-raw": "^6.1.1", 19 | "remark-gfm": "^3.0.1", 20 | "remark-math": "^5.1.1", 21 | "streamlit-component-lib": "^1.4.0" 22 | }, 23 | "devDependencies": { 24 | "@types/react": "^18.0.37", 25 | "@types/react-dom": "^18.0.11", 26 | "@typescript-eslint/eslint-plugin": "^5.59.0", 27 | "@typescript-eslint/parser": "^5.59.0", 28 | "@vitejs/plugin-react-swc": "^3.0.0", 29 | "eslint": "^8.38.0", 30 | "eslint-plugin-react-hooks": "^4.6.0", 31 | "eslint-plugin-react-refresh": "^0.3.4", 32 | "typescript": "^5.0.2", 33 | "vite": "^4.3.9" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Streamlit Component 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 |
19 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/Chat.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from "react" 2 | 3 | function ChatElement(props: React.PropsWithChildren<{ 4 | isUser: boolean, 5 | avatar: boolean, 6 | children: ReactNode 7 | }>) { 8 | const { isUser, avatar, children } = props 9 | let classList: string[] = ['chat'] 10 | 11 | if (isUser) 12 | classList.push('user') 13 | 14 | if (!avatar) 15 | classList.push('no-avatar') 16 | 17 | return ( 18 |
19 | {children} 20 |
21 | ) 22 | } 23 | 24 | export default ChatElement 25 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/avatar.tsx: -------------------------------------------------------------------------------- 1 | import { ReactElement } from "react" 2 | 3 | function Avatar(props: {src: string}): ReactElement { 4 | return ( 5 |
6 | profile 7 |
8 | ) 9 | } 10 | 11 | export default Avatar -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; 3 | line-height: 1.5; 4 | font-weight: 400; 5 | 6 | color-scheme: light dark; 7 | color: rgba(255, 255, 255, 0.87); 8 | background-color: #242424; 9 | 10 | font-synthesis: none; 11 | text-rendering: optimizeLegibility; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | -webkit-text-size-adjust: 100%; 15 | } 16 | 17 | a { 18 | font-weight: 500; 19 | color: #646cff; 20 | text-decoration: inherit; 21 | } 22 | a:hover { 23 | color: #535bf2; 24 | } 25 | 26 | body { 27 | margin: 0; 28 | display: flex; 29 | place-items: center; 30 | min-width: 320px; 31 | min-height: 100vh; 32 | } 33 | 34 | h1 { 35 | font-size: 3.2em; 36 | line-height: 1.1; 37 | } 38 | 39 | button { 40 | border-radius: 8px; 41 | border: 1px solid transparent; 42 | padding: 0.6em 1.2em; 43 | font-size: 1em; 44 | font-weight: 500; 45 | font-family: inherit; 46 | background-color: #1a1a1a; 47 | cursor: pointer; 48 | transition: border-color 0.25s; 49 | } 50 | button:hover { 51 | border-color: #646cff; 52 | } 53 | button:focus, 54 | button:focus-visible { 55 | outline: 4px auto -webkit-focus-ring-color; 56 | } 57 | 58 | @media (prefers-color-scheme: light) { 59 | :root { 60 | color: #213547; 61 | background-color: #ffffff; 62 | } 63 | a:hover { 64 | color: #747bff; 65 | } 66 | button { 67 | background-color: #f9f9f9; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import Chat from './stChat.tsx' 4 | // import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/message.tsx: -------------------------------------------------------------------------------- 1 | import ReactMarkdown from "react-markdown" 2 | import remarkMath from "remark-math" 3 | import rehypeKatex from "rehype-katex" 4 | import rehypeRaw from "rehype-raw" 5 | import remarkGfm from "remark-gfm" 6 | import rehypeHighlight from "rehype-highlight" 7 | 8 | import 'katex/dist/katex.min.css' 9 | import 'highlight.js/styles/monokai-sublime.css' 10 | import React, { ReactElement } from "react" 11 | 12 | function Message(props: React.PropsWithChildren<{ is_table: boolean, message: string, allow_html: boolean }>): ReactElement { 13 | // Init React Markdown plugins 14 | const remarkPlugins = [ 15 | remarkMath, 16 | remarkGfm 17 | ] 18 | const rehypePlugins = [ 19 | rehypeKatex, 20 | ...(props.allow_html ? [rehypeRaw] : []) 21 | ] 22 | 23 | let classList = ["msg"]; 24 | 25 | if (props.is_table) 26 | classList.push("msg-table") 27 | 28 | return ( 29 |
30 | 35 | {props.message} 36 | 37 |
38 | ) 39 | } 40 | 41 | export default Message; 42 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/stChat.css: -------------------------------------------------------------------------------- 1 | #root { 2 | margin: 0 auto; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | } 8 | 9 | .chat { 10 | display: flex; 11 | font-family: var(--font), 'Segoe UI', 'Roboto', 'sans-serif'; 12 | flex-direction: row; 13 | height: auto; 14 | margin: 0; 15 | width: 100%; 16 | } 17 | 18 | .chat.user { 19 | flex-direction: row-reverse; 20 | } 21 | 22 | .chat .avatar { 23 | align-items: center; 24 | border: 1px solid transparent; 25 | border-radius: 50%; 26 | color: var(--text-color); 27 | display: flex; 28 | /* display: inline-block; */ 29 | height: 3rem; 30 | justify-content: center; 31 | margin: 3px; 32 | overflow: hidden; 33 | width: 3rem; 34 | } 35 | 36 | .chat .avatar img { 37 | height: 100%; 38 | } 39 | 40 | .chat .msg { 41 | display: inline-block; 42 | background: var(--secondary-bg-color); 43 | border: 1px solid transparent; 44 | border-radius: 10px; 45 | padding: 10px; 46 | line-height: 1.2; 47 | margin: 0 5px; 48 | max-width: 70%; 49 | min-height: 1.5rem; 50 | white-space: pre-line; 51 | } 52 | 53 | .chat .msg::after { 54 | content: ""; 55 | top: 0; 56 | position: absolute; 57 | border: 0.75em solid transparent; 58 | border-top-color: var(--secondary-bg-color); 59 | display: block; 60 | left: 3.1rem; 61 | } 62 | 63 | .chat.user .msg::after { 64 | right: 3.1rem; 65 | left: auto; 66 | } 67 | 68 | .chat .msg p { 69 | margin-block: 0; 70 | } 71 | 72 | .chat .msg a:hover { 73 | color: var(--primary-color); 74 | } 75 | 76 | .chat .msg.msg-table { 77 | white-space: normal; 78 | } 79 | 80 | .chat .msg:has(> table) { 81 | white-space: normal; 82 | } 83 | 84 | .chat .msg table { 85 | border-collapse: collapse; 86 | margin: 10px; 87 | } 88 | 89 | .chat .msg td, 90 | .chat .msg th { 91 | border: 1px solid var(--text-color); 92 | padding: 3px; 93 | } 94 | 95 | /* Styles for No Avatar */ 96 | .chat.no-avatar .avatar { 97 | height: 0; 98 | width: 0; 99 | } 100 | 101 | .chat.no-avatar .msg { 102 | max-width: 85%; 103 | } 104 | 105 | .chat.no-avatar .msg::after { 106 | left: 0.2rem; 107 | } 108 | 109 | .chat.no-avatar.user .msg::after { 110 | right: 0.2rem; 111 | left: auto; 112 | } 113 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/stChat.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | // eslint-disable-next-line 3 | Streamlit, 4 | StreamlitComponentBase, 5 | withStreamlitConnection, 6 | } from "streamlit-component-lib" 7 | import { ReactNode } from "react" 8 | 9 | import './stChat.css' 10 | import Avatar from "./avatar" 11 | import Message from "./message" 12 | import ChatElement from './Chat.tsx' 13 | 14 | class Chat extends StreamlitComponentBase { 15 | public render = (): ReactNode => { 16 | Streamlit.setFrameHeight(window.innerHeight) 17 | 18 | // const { isUser, avatarStyle, seed, message, logo } = this.props.args; 19 | const { isUser, avatarStyle, seed, message, logo, allow_html, is_table } = this.props.args; 20 | const avatarUrl: string = !!logo ? logo: `https://api.dicebear.com/5.x/${avatarStyle}/svg?seed=${seed}` 21 | 22 | // Streamlit sends us a theme object via props that we can use to ensure 23 | // that our component has visuals that match the active theme in a 24 | // streamlit app. 25 | const { theme } = this.props 26 | 27 | // Maintain compatibility with older versions of Streamlit that don't send 28 | // a theme object. 29 | if (!theme) { 30 | return
Theme is undefined, please check streamlit version.
31 | } 32 | 33 | // set CSS variables for theme 34 | let body = document.querySelector('body') 35 | body?.style.setProperty('--secondary-bg-color', theme.secondaryBackgroundColor) 36 | body?.style.setProperty('--bg-color', theme.backgroundColor) 37 | body?.style.setProperty('--primary-color', theme.primaryColor) 38 | body?.style.setProperty('--text-color', theme.textColor) 39 | body?.style.setProperty('--font', theme.font) 40 | 41 | 42 | return ( 43 | 44 | 45 | 46 | 47 | ) 48 | } 49 | } 50 | 51 | export default withStreamlitConnection(Chat); 52 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 6 | "module": "ESNext", 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "noEmit": true, 15 | "jsx": "react-jsx", 16 | 17 | /* Linting */ 18 | "strict": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": ["src"], 24 | "references": [{ "path": "./tsconfig.node.json" }] 25 | } 26 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /streamlit_chat/frontend/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react-swc' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | server: { 8 | port: 3001, 9 | }, 10 | base: '', 11 | }) 12 | -------------------------------------------------------------------------------- /test_component.py: -------------------------------------------------------------------------------- 1 | from streamlit_chat import message, NO_AVATAR 2 | import streamlit as st 3 | 4 | 5 | audio_path = "https://docs.google.com/uc?export=open&id=16QSvoLWNxeqco_Wb2JvzaReSAw5ow6Cl" 6 | img_path = "https://www.groundzeroweb.com/wp-content/uploads/2017/05/Funny-Cat-Memes-11.jpg" 7 | youtube_embed = ''' 8 | 9 | ''' 10 | 11 | markdown = """ 12 | ### HTML in markdown is ~quite~ **unsafe** 13 | 14 |
15 | However, if you are in a trusted environment (you trust the markdown). You can use allow_html props to enable support for html. 16 |
17 | 18 | * Lists 19 | * [ ] todo 20 | * [x] done 21 | 22 | Math: 23 | 24 | Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following 25 | equation. 26 | 27 | $$ 28 | L = \\frac{1}{2} \\rho v^2 S C_L 29 | $$ 30 | 31 | ```py 32 | import streamlit as st 33 | st.write("Python code block") 34 | ``` 35 | 36 | ~~~js 37 | console.log("Here is some JavaScript code") 38 | ~~~ 39 | """ 40 | 41 | table_markdown = ''' 42 | A Table: 43 | 44 | | Feature | Support | 45 | | ----------: | :------------------- | 46 | | CommonMark | 100% | 47 | | GFM | 100% w/ `remark-gfm` | 48 | ''' 49 | 50 | long_message = """A chatbot or chatterbot is a software application used to conduct an on-line chat conversation via text or text-to-speech, in lieu of providing direct contact with a live human agent. 51 | Designed to convincingly simulate the way a human would behave as a conversational partner, chatbot systems typically require continuous tuning and testing, and many in production remain unable to adequately converse, while none of them can pass the standard Turing test. 52 | The term "ChatterBot" was originally coined by Michael Mauldin (creator of the first Verbot) in 1994 to describe these conversational programs. 53 | 54 | [streamlit website](https://streamlit.io) 55 | """ 56 | 57 | def on_input_change(): 58 | user_input = st.session_state.user_input 59 | st.session_state.past.append(user_input) 60 | st.session_state.generated.append("The messages from Bot\nWith new line") 61 | 62 | def on_btn_click(): 63 | del st.session_state.past[:] 64 | del st.session_state.generated[:] 65 | 66 | if __name__ == '__main__': 67 | st.session_state.setdefault( 68 | 'past', 69 | ["Hey, \nwhat's a chatbot?", 70 | 'plan text with line break', 71 | 'play the song "Dancing Vegetables"', 72 | 'show me image of cat', 73 | 'and video of it', 74 | 'show me some markdown sample', 75 | 'table in markdown'] 76 | ) 77 | 78 | st.session_state.setdefault( 79 | 'generated', 80 | [{'type': 'normal', 'data': long_message}, 81 | {'type': 'normal', 'data': 'Line 1 \n Line 2 \n Line 3'}, 82 | {'type': 'normal', 'data': f''}, 83 | {'type': 'normal', 'data': f''}, 84 | {'type': 'normal', 'data': f'{youtube_embed}'}, 85 | {'type': 'normal', 'data': f'{markdown}'}, 86 | {'type': 'table', 'data': f'{table_markdown}'}] 87 | ) 88 | 89 | st.title("Chat placeholder") 90 | 91 | chat_placeholder = st.empty() 92 | 93 | with chat_placeholder.container(): 94 | for i in range(len(st.session_state['generated'])): 95 | message(st.session_state['past'][i], is_user=True, key=f"{i}_user") 96 | message( 97 | st.session_state['generated'][i]['data'], 98 | key=f"{i}", 99 | allow_html=True, 100 | is_table=st.session_state['generated'][i]['type']=='table', 101 | avatar_style=NO_AVATAR 102 | ) 103 | st.button("Clear message", on_click=on_btn_click) 104 | 105 | with st.container(): 106 | st.text_input("User Input:", on_change=on_input_change, key="user_input") 107 | -------------------------------------------------------------------------------- /todo.txt: -------------------------------------------------------------------------------- 1 | 3. local media 2 | 5. Disable user/bot avatar 3 | 4. improve CSS for visual elements 4 | 6. Streamline text display 5 | 1. Copy to Clipboard 6 | 2. container for ChatBox 7 | 7. wait for next message (Loader) 8 | 9 | import streamlit_chat as stc 10 | 11 | config = { 12 | 'bot_avatar': False | 'url' | ('bottts', 80) 13 | } 14 | 15 | cb = stc.ChatBox(**config) 16 | 17 | cb.populate(user_res, bot_res, streamline=True, wait_for_msg=True, bot_first = True) 18 | 19 | # 2 api's 20 | # 1 : user & bot responses in arrays/lists 21 | 22 | u: ['hi', 'i want ice cream', 'bye'] 23 | b: ['hello, how may i help you', 'ice cream is not good'] 24 | 25 | # 2 : single structured array/lists 26 | history: 27 | [ 28 | (stc.USER, 'content', 'text'), 29 | (stc.BOT, 'url', 'image'), 30 | (stc.BOT, 'content', 'html'), 31 | ] 32 | 33 | hist = stc.History() 34 | hist.add_bot('content', 'type') 35 | hist.add_user('content', 'type') 36 | --------------------------------------------------------------------------------