-[pykoi](https://www.cambioml.com/pykoi/) is an open-source python library for improving LLMs with RLHF. We provide a unified interface including RLHF/RLAIF data and feedback collection, finetuning with reinforcement learning and reward modeling, and LLM comparisons.
+[pykoi](https://www.cambioml.com/pykoi/) is an open-source python library for improving LLMs with RLHF. We provide a unified interface including RLHF/RLAIF data and feedback collection, finetuning with reinforcement learning and reward modeling, and LLM comparisons.
## Features
@@ -26,12 +26,12 @@ Do you want to store your chat history with LLMs from OpenAI, Amazon Bedrock(:wo
### Model comparison
-Comparing models is a difficult task. `pykoi` makes it easy by allowing one to directly compare the performance of multiple models to each other, with just a few lines of code. If you have multiple language models that you’d like to compare to each other on a set of prompts or via an interactive session, you can use `pk.Compare`. Check out any of the demo below:
+Comparing models is a difficult task. `pykoi` makes it easy by allowing one to directly compare the performance of multiple models to each other, with just a few lines of code. If you have multiple language models that you’d like to compare to each other on a set of prompts or via an interactive session, you can use `pk.Compare`. Check out any of the demo below:
- If you're using a CPU instance, check out [demo_launch_app_cpu.ipynb](https://nbviewer.org/github/CambioML/pykoi/blob/main/example/chatbot/demo_model_comparator_openai.ipynb)
- If you're using a GPU instance, check out [demo_launch_app_gpu.ipynb](https://nbviewer.org/github/CambioML/pykoi/blob/main/example/chatbot/demo_model_comparator_gpu_huggingface.ipynb)
- Alternatively, read our [blog](https://www.cambioml.com/docs/model_comparison.html) for more information!
-
+
![Watch the video](example/image/pykoi_demo_model_comparison.gif)
### RLHF
@@ -40,6 +40,19 @@ Reinforcement Learning with Human Feedback (RLHF) is a unique training paradigm
`pykoi` allows you to easily fine-tune your model on the datasets you've collected via your `pykoi` chat or rank databases. Check our [blog](https://www.cambioml.com/docs/rlhf.html) for detailed instructions on how to use it.
+### RAG
+Implement a Retrieval-Augmented Generation (RAG) Chatbot quickly with `pykoi`. Upload your own documents to create context-aware responses on top of a pretrained LLM, such as from OpenAI or Huggingface.
+
+![Watch the video](example/image/pykoi_demo_rag_chatbot_upload.gif)
+
+Then chat with the RAG Chatbot, where you can select specific sources for the text generation, as well as see which sources the model used to generate the response.
+
+![Watch the video](example/image/pykoi_demo_rag_chatbot_chat.gif)
+
+Finally, you can save a modified response to help improve the model. This is a great way to collect data for RLHF.
+
+![Watch the video](example/image/pykoi_demo_rag_chatbot_modify.gif)
+
## Installation
To get started with pykoi, you can choose from any of the installation options. The choice should be based on the features you need (e.g., RAG, RLHF or all) and the compute resources you have, such as a CPU (e.g., your laptop) or GPU (e.g., AWS EC2 or SageMaker).
@@ -56,10 +69,10 @@ conda activate pykoi # some OS requires `source activate pykoi`
Then install `pykoi` and the compatible [pytorch based on your os](https://pytorch.org/get-started/locally/)
```
pip3 install "pykoi[rag]"
-pip3 install torch
+pip3 install torch
```
-### Option 2: RAG (GPU)
+### Option 2: RAG (GPU)
This option allows you to run RAG on a GPU using an open-source LLM from HuggingFace. Here's a quick [tutorial](#ec2-dev-setup) on setting up an EC2 GPU instance for the installation below.
On your GPU instance terminal, create a conda environment using:
@@ -74,7 +87,7 @@ pip3 install "pykoi[rag, huggingface]"
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 # cu121 means cuda 12.1
```
-### Option 3: RLHF (GPU)
+### Option 3: RLHF (GPU)
This option allows you to train LLM via RLHF on a GPU. Here's a quick [tutorial](#ec2-dev-setup) on setting up an EC2 GPU instance for the installation below.
On your GPU instance terminal, create a conda environment using:
@@ -89,7 +102,7 @@ pip3 install "pykoi[rlhf]"
pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 # cu121 means cuda 12.1
```
-Congrats you have finished the installation!
+Congrats you have finished the installation!
## Dev Setup
If you are interested to contribute to us, here are the preliminary development setup.
@@ -104,15 +117,15 @@ pip3 install poetry
Then, based the feature you need to develop, run one or more installation options below. We recommend install all the options below although it may take ~3 minutes longer.
-- Option 1: RAG (CPU)
+- Option 1: RAG (CPU)
```
poetry install --no-root --extras rag
```
-- Option 2: RAG (GPU)
+- Option 2: RAG (GPU)
```
poetry install --no-root --extras "rag huggingface"
```
-- Option 3: RLHF (GPU)
+- Option 3: RLHF (GPU)
```
poetry install --no-root --extras rlhf
```
diff --git a/example/image/pykoi_demo_rag_chatbot_chat.gif b/example/image/pykoi_demo_rag_chatbot_chat.gif
new file mode 100644
index 0000000..7ceca02
Binary files /dev/null and b/example/image/pykoi_demo_rag_chatbot_chat.gif differ
diff --git a/example/image/pykoi_demo_rag_chatbot_modify.gif b/example/image/pykoi_demo_rag_chatbot_modify.gif
new file mode 100644
index 0000000..374223b
Binary files /dev/null and b/example/image/pykoi_demo_rag_chatbot_modify.gif differ
diff --git a/example/image/pykoi_demo_rag_chatbot_upload.gif b/example/image/pykoi_demo_rag_chatbot_upload.gif
new file mode 100644
index 0000000..f274087
Binary files /dev/null and b/example/image/pykoi_demo_rag_chatbot_upload.gif differ
diff --git a/example/retrieval_qa/retrieval_qa_demo.py b/example/retrieval_qa/retrieval_qa_demo.py
deleted file mode 100644
index 23d1c26..0000000
--- a/example/retrieval_qa/retrieval_qa_demo.py
+++ /dev/null
@@ -1,72 +0,0 @@
-"""Demo for the retrieval_qa application."""
-
-import os
-import argparse
-from pykoi import Application
-from pykoi.chat import QuestionAnswerDatabase
-from pykoi.retrieval import RetrievalFactory
-from pykoi.retrieval import VectorDbFactory
-from pykoi.component import Chatbot, Dashboard, RetrievalQA
-
-
-def main(**kargs):
- # enter openai api key here
- os.environ["OPENAI_API_KEY"] = ""
- os.environ["DOC_PATH"] = os.path.join(os.getcwd(), "temp/docs")
- os.environ["VECTORDB_PATH"] = os.path.join(os.getcwd(), "temp/vectordb")
- MODEL_SOURCE = "openai"
-
- #####################################
- # Creating a retrieval QA component #
- #####################################
- # vector database
- vector_db = VectorDbFactory.create(
- model_source=MODEL_SOURCE, vector_db_name=kargs.get("vectordb"), **kargs
- )
-
- # retrieval model with vector database
- retrieval_model = RetrievalFactory.create(
- model_source=MODEL_SOURCE, vector_db=vector_db
- )
-
- # retrieval, chatbot, and dashboard pykoi components
- retriever = RetrievalQA(retrieval_model=retrieval_model, vector_db=vector_db)
- chatbot = Chatbot(None, feedback="vote", is_retrieval=True)
- dashboard = Dashboard(QuestionAnswerDatabase())
-
- ############################################################
- # Starting the application and retrieval qa as a component #
- ############################################################
- # Create the application
- app = Application(debug=False, share=False)
- app.add_component(retriever)
- app.add_component(chatbot)
- app.add_component(dashboard)
- app.run()
-
-
-if __name__ == "__main__":
- # Parse the command-line arguments
- parser = argparse.ArgumentParser(description="Demo for the Retrieval QA.")
- parser.add_argument(
- "-vectordb",
- type=str,
- default="chroma",
- help="Name of the vector database (default: 'chroma')",
- )
- parser.add_argument(
- "-host",
- type=str,
- default="localhost",
- help="Host address if using Epsilla vector database",
- )
- parser.add_argument(
- "-port",
- type=int,
- default=8888,
- help="Port number if using Epsilla vector database",
- )
- args = parser.parse_args()
-
- # Call the main function with the vector_db_name argument
- main(**vars(args))
diff --git a/example/retrieval_qa/retrieval_qa_huggingface_demo.py b/example/retrieval_qa/retrieval_qa_huggingface_demo.py
index e42dcaf..9de0e8a 100644
--- a/example/retrieval_qa/retrieval_qa_huggingface_demo.py
+++ b/example/retrieval_qa/retrieval_qa_huggingface_demo.py
@@ -3,7 +3,7 @@
import os
import argparse
from pykoi import Application
-from pykoi.chat import QuestionAnswerDatabase
+from pykoi.chat import RAGDatabase
from pykoi.retrieval import RetrievalFactory
from pykoi.retrieval import VectorDbFactory
from pykoi.component import Chatbot, Dashboard, RetrievalQA
@@ -36,9 +36,9 @@ def main(**kwargs):
)
# retrieval, chatbot, and dashboard pykoi components
- retriever = RetrievalQA(retrieval_model=retrieval_model, vector_db=vector_db)
- chatbot = Chatbot(None, feedback="vote", is_retrieval=True)
- dashboard = Dashboard(QuestionAnswerDatabase())
+ retriever = RetrievalQA(retrieval_model=retrieval_model, vector_db=vector_db, feedback="rag")
+ chatbot = Chatbot(None, feedback="rag", is_retrieval=True)
+ dashboard = Dashboard(RAGDatabase(), feedback="rag")
############################################################
# Starting the application and retrieval qa as a component #
diff --git a/example/flex/flex_demo.py b/example/retrieval_qa/retrieval_qa_openai_demo.py
similarity index 98%
rename from example/flex/flex_demo.py
rename to example/retrieval_qa/retrieval_qa_openai_demo.py
index 60bf66c..e02fcf7 100644
--- a/example/flex/flex_demo.py
+++ b/example/retrieval_qa/retrieval_qa_openai_demo.py
@@ -4,7 +4,6 @@
import argparse
from dotenv import load_dotenv
from pykoi import Application
-from pykoi.chat import QuestionAnswerDatabase
from pykoi.retrieval import RetrievalFactory
from pykoi.retrieval import VectorDbFactory
from pykoi.component import Chatbot, Dashboard, RetrievalQA
diff --git a/pykoi/application.py b/pykoi/application.py
index 05bedd8..238b0ac 100644
--- a/pykoi/application.py
+++ b/pykoi/application.py
@@ -644,13 +644,13 @@ async def inference(
try:
print("[/retrieval]: model inference.....", request_body.prompt)
component["component"].retrieval_model.re_init(request_body.file_names)
- output = component[
- "component"
- ].retrieval_model.run_with_return_source_documents(
- {"query": request_body.prompt}
- )
- print("output", output, output["result"])
- if output["source_documents"] == []:
+ output = component["component"].retrieval_model.run_with_return_source_documents({"query": request_body.prompt})
+ print('output', output, output["result"])
+ if "source_documents" not in output:
+ print('no source documents', output)
+ source = ["N/A"]
+ source_content = ["N/A"]
+ elif output["source_documents"] == []:
source = ["N/A"]
source_content = ["N/A"]
else:
diff --git a/pykoi/frontend/dist/assets/index-10f2d9f3.css b/pykoi/frontend/dist/assets/index-10f2d9f3.css
deleted file mode 100644
index 8a05e68..0000000
--- a/pykoi/frontend/dist/assets/index-10f2d9f3.css
+++ /dev/null
@@ -1 +0,0 @@
-@import"https://fonts.googleapis.com/css?family=Work+Sans:400|Lato:400|Inconsolata:400";:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:auto;width:100%}h1{font-size:3.2em;line-height:1.1}.card{padding:2em}#app{margin:0 auto;text-align:center}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Inconsolata", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px}header{color:var(--headerTextColor);position:fixed;left:0;top:0;width:100%;height:var(--headerHeight);background:var(--headerBackground);border-bottom:var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;position:absolute;bottom:0;width:100%}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:5px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 300px}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--white);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--green);--footerTextColor: var(--black);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px;--height: height: calc(100vh - var(--headerHeight))}html{box-sizing:border-box;font-size:var(--baseFontSize)}*,*:before,*:after{box-sizing:inherit}body{font-family:var(--bodyFont);font-weight:400;line-height:1.75;background:var(--background);color:var(--textColor)}header{color:var(--headerTextColor);margin-top:1%;height:var(--headerHeight);background:var(--headerBackground);font-size:var(--h5);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}header nav a{color:var(--white);text-decoration:none}header nav a+a{margin-left:10px}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;bottom:0;width:100%}footer a{color:var(--footerTextColor)}footer nav a+a{margin-left:10px}footer p{margin-bottom:0;max-width:none}p{margin-bottom:1rem}p a,blockquote a{color:var(--textColor);text-decoration:none;border-bottom:var(--borderBottom)}h1,h2,h3,h4,h5{margin:3rem 0 1.38rem;font-family:var(--headingFont);font-weight:400;line-height:1.15}h1{margin-top:0;font-size:var(--h1)}h2{font-size:var(--h2)}h3{font-size:var(--h3)}h4{font-size:var(--h4)}h5{font-size:var(--h5)}small,.text_small{font-size:var(--smallText)}blockquote{margin:10px;padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg)}label{display:block;font-size:var(--smallText)}input,textarea{padding:2px 5px;border:var(--line);border-radius:4px}textarea{width:100%;height:5rem}::placeholder{color:var(--grey)}::selection,.highlight{background:#ffb7b7;background:var(--red);color:var(--white)}select{border:var(--line)}hr{border-top:var(--line)}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:10px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}button:hover{cursor:pointer;box-shadow:var(--shadow-md)}button[disabled]{opacity:.4}button.cancel{--buttonColor: var(--danger);--buttonTextColor: var(--white)}button.small{font-size:var(--smallText)}.layout{padding-top:calc(0rem + var(--headerHeight))}.grid{--gridCols: 2;display:block;grid-template-columns:repeat(var(--gridCols),1fr)}.cols-3{--gridCols: 3}.cols-4{--gridCols: 4}.flex{--justifyContent: space-between;display:block;justify-content:var(--justifyContent)}.flex-around{--justifyContent: space-around}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius)}.grid-split{display:grid;grid-template-columns:33% 67%;gap:20px}@media only screen and (min-width: 600px){:root{--baseFontSize: 100%}.grid{display:grid}.flex{display:flex}}.logo{font-size:var(--baseFontSize);margin:0 0 0 8px}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--yellow);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.oled{--black: #000;--cardBg: var(--darkGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 25px}.grid-sidemenu{--gridCols: 2;display:grid;grid-template-columns:var(--left) 1fr}header{padding:0 15px 0 0}header nav a+a{margin-left:15px}.corner{margin-left:var(--left)}header nav a{color:var(--black);text-decoration:none}.page{padding:3em}.page-title{text-decoration:none;border-bottom:var(--borderBottom)}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius);font-size:var(--smallText)}.card:hover{box-shadow:var(--shadow-xl)}.card>*:first-child{margin-top:0}.card>*:last-child{margin-bottom:0}table{margin:auto}button{margin:5px}dialog.svelte-g384pz.svelte-g384pz{max-width:32em;border-radius:1em;border:none;padding:0}dialog.svelte-g384pz.svelte-g384pz::backdrop{background:rgba(0,0,0,.3)}dialog.svelte-g384pz>div.svelte-g384pz{padding:1em}dialog[open].svelte-g384pz.svelte-g384pz{animation:svelte-g384pz-zoom .3s cubic-bezier(.34,1.56,.64,1)}@keyframes svelte-g384pz-zoom{0%{transform:scale(.95)}to{transform:scale(1)}}dialog[open].svelte-g384pz.svelte-g384pz::backdrop{animation:svelte-g384pz-fade .2s ease-out}@keyframes svelte-g384pz-fade{0%{opacity:0}to{opacity:1}}button.svelte-g384pz.svelte-g384pz{display:block}.close-button.svelte-g384pz.svelte-g384pz{display:block;height:30px;width:30px;border-radius:50%;border:1px solid var(--grey);padding:0}.close-button.svelte-g384pz.svelte-g384pz:hover{background-color:var(--lightGrey)}.btn-container.svelte-g384pz.svelte-g384pz{display:flex;justify-content:flex-end}.btn-container.svelte-sy2m0x.svelte-sy2m0x{display:flex;justify-content:center;padding-top:1em}div.inputs.svelte-sy2m0x.svelte-sy2m0x{display:grid;grid-template-columns:max-content max-content;grid-gap:5px}div.inputs.svelte-sy2m0x label.svelte-sy2m0x{text-align:right}h4.svelte-sy2m0x.svelte-sy2m0x{margin:20px 0}.small-button.svelte-19cad35.svelte-19cad35{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-19cad35.svelte-19cad35{text-align:center;margin:auto;width:20%}.small-button.svelte-19cad35.svelte-19cad35:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-19cad35.svelte-19cad35,.thumbs-up.svelte-19cad35.svelte-19cad35:hover,.thumbs-up.svelte-19cad35.svelte-19cad35::selection{background:var(--green)}.thumbs-down.svelte-19cad35.svelte-19cad35,.thumbs-down.svelte-19cad35.svelte-19cad35:hover,.thumbs-down.svelte-19cad35.svelte-19cad35::selection{background:var(--red)}.ranked-chat.svelte-19cad35.svelte-19cad35{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-19cad35.svelte-19cad35{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-19cad35.svelte-19cad35{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-19cad35.svelte-19cad35{display:flex;width:100%}.btnyousend.svelte-19cad35.svelte-19cad35{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-19cad35.svelte-19cad35{opacity:1}.green.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--green)}.red.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--red)}.instructions.svelte-19cad35.svelte-19cad35{text-align:center;padding:5%}.instructions.svelte-19cad35 h5.svelte-19cad35{text-align:left}.instructions.svelte-19cad35 p.svelte-19cad35{font-size:var(--smallText);text-align:left}.instructions.svelte-19cad35 button.svelte-19cad35{font-size:var(--smallText)}.ranked-feedback-container.svelte-19cad35.svelte-19cad35{display:grid;grid-template-columns:20% 80%}.underline.svelte-19cad35.svelte-19cad35{border-bottom:var(--line)}.bold.svelte-19cad35.svelte-19cad35{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-19cad35.svelte-19cad35{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-19cad35.svelte-19cad35{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-19cad35 .question.svelte-19cad35{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-19cad35 .answer.svelte-19cad35{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-19cad35 .answers.svelte-19cad35{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(50%);padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.ranked-chat.svelte-au920n.svelte-au920n{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-au920n.svelte-au920n{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-au920n.svelte-au920n{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-au920n.svelte-au920n{display:flex;width:100%}.btnyousend.svelte-au920n.svelte-au920n{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-au920n.svelte-au920n{opacity:1}.green.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--green)}.red.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--red)}.instructions.svelte-au920n.svelte-au920n{text-align:center;padding:5%}.instructions.svelte-au920n h5.svelte-au920n{text-align:left}.instructions.svelte-au920n p.svelte-au920n{font-size:var(--smallText);text-align:left}.instructions.svelte-au920n button.svelte-au920n{font-size:var(--smallText)}.ranked-feedback-container.svelte-au920n.svelte-au920n{display:grid;grid-template-columns:20% 80%}.underline.svelte-au920n.svelte-au920n{border-bottom:var(--line)}.bold.svelte-au920n.svelte-au920n{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-au920n.svelte-au920n{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-au920n.svelte-au920n{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-au920n .question.svelte-au920n{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-au920n .answer.svelte-au920n{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-au920n .answers.svelte-au920n{display:grid;grid-template-columns:49% 49%;gap:2%;width:100%;margin:auto}.multiselect.svelte-8o2wf2.svelte-8o2wf2{position:relative;max-width:200px}.selectBox.svelte-8o2wf2.svelte-8o2wf2{position:relative}.selectBox.svelte-8o2wf2 select.svelte-8o2wf2{width:100%;font-weight:700}.overSelect.svelte-8o2wf2.svelte-8o2wf2{position:absolute;left:0;right:0;top:0;bottom:0}.dropdown-content.svelte-8o2wf2.svelte-8o2wf2{position:absolute;top:100%;left:0;width:100%;border:1px #dadada solid;background-color:#fff;z-index:1}.source.svelte-1pk2e1k{text-align:left;background-color:var(--lightGrey);border:1px solid var(--grey);border-top:none;padding:0 5px;margin:0;color:var(--darkGrey);box-sizing:border-box}.source_tab.svelte-1pk2e1k{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.source_content.svelte-1pk2e1k{border:1pt solid var(--grey);padding:5px;margin-bottom:5px;background-color:#fff;color:var(--darkGrey)}p.svelte-1pk2e1k{margin:0;padding:0}.source.svelte-1pk2e1k:nth-of-type(2){border-top:1px solid var(--grey)}.sources.svelte-1r759df{display:inline-block;text-align:left;padding:5px;border:1pt solid var(--grey)}.sources-header.svelte-1r759df{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.box.svelte-iwm583.svelte-iwm583{margin-bottom:10px;padding:40px;border:1px solid #dee2e6;border-radius:0 0 .5rem .5rem;border-top:0}ul.svelte-iwm583.svelte-iwm583{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none;border-bottom:1px solid #dee2e6}li.svelte-iwm583.svelte-iwm583{margin-bottom:-1px}span.svelte-iwm583.svelte-iwm583{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem;display:block;padding:.5rem 1rem;cursor:pointer}span.svelte-iwm583.svelte-iwm583:hover{border-color:#e9ecef #e9ecef #dee2e6;color:#495057}li.svelte-iwm583>span.svelte-iwm583{color:var(--grey)}li.active.svelte-iwm583>span.svelte-iwm583{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.button-container.svelte-i9wciy{display:flex;justify-content:space-between}.note.svelte-i9wciy{font-size:var(--smallText);color:var(--gray)}.small-button.svelte-1u8cd0w{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-1u8cd0w{display:flex;text-align:center;margin:auto;width:20%}.small-button.svelte-1u8cd0w:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-1u8cd0w,.thumbs-up.svelte-1u8cd0w:hover,.thumbs-up.svelte-1u8cd0w::selection{background:var(--green)}.thumbs-down.svelte-1u8cd0w,.thumbs-down.svelte-1u8cd0w:hover,.thumbs-down.svelte-1u8cd0w::selection{background:var(--red)}.chat-and-question.svelte-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%;width:100%}.ranked-chat.svelte-vgv4ev.svelte-vgv4ev{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-vgv4ev.svelte-vgv4ev{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-vgv4ev.svelte-vgv4ev{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-vgv4ev.svelte-vgv4ev{display:flex;width:100%}.btnyousend.svelte-vgv4ev.svelte-vgv4ev{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-vgv4ev.svelte-vgv4ev{opacity:1}.green.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--green)}.red.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--red)}.instructions.svelte-vgv4ev.svelte-vgv4ev{text-align:center;padding:5%}.instructions.svelte-vgv4ev h5.svelte-vgv4ev{text-align:left}.instructions.svelte-vgv4ev p.svelte-vgv4ev{font-size:var(--smallText);text-align:left}.instructions.svelte-vgv4ev button.svelte-vgv4ev{font-size:var(--smallText)}.ranked-feedback-container.svelte-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%}.underline.svelte-vgv4ev.svelte-vgv4ev{border-bottom:var(--line)}.bold{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-vgv4ev.svelte-vgv4ev{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-vgv4ev.svelte-vgv4ev{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-vgv4ev .question.svelte-vgv4ev{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-vgv4ev .answer.svelte-vgv4ev{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-vgv4ev .answers.svelte-vgv4ev{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}.rag-sources.svelte-vgv4ev.svelte-vgv4ev{display:flex}.tooltip{white-space:nowrap;position:relative;padding-top:.35rem;cursor:zoom-in}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(calc(100% - 120px));padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:10px;width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.series.svelte-tg5p7i:focus{outline:none}.horizontal-bar-rect.selected.svelte-tg5p7i{stroke:var(--black);stroke-width:3}#stackedrect-holder.svelte-tg5p7i{height:100%;width:100%}.line.svelte-tg5p7i{stroke-width:3;stroke:var(--black);fill:none}.horizontal-bar-rect.svelte-tg5p7i{transition:opacity .3s}.horizontal-bar-rect.svelte-tg5p7i:hover{stroke:var(--black);stroke-width:3}.horizontal-bar-text.svelte-tg5p7i{transition:opacity .3s;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none;font-size:var(--smallText)}.qa-card.svelte-szi0e{border:2px solid var(--black);display:flex;flex-direction:column;font-size:var(--smallText);padding:4px;margin:6px}.qa-card.svelte-szi0e:hover{border:3px solid var(--black)}.question.svelte-szi0e{background-color:var(--white);margin:0;padding:8px;border-bottom:1px solid var(--black)}.answer.svelte-szi0e{background-color:var(--lightGrey);margin:0;padding:8px}.feedback.svelte-szi0e{margin:0;padding:8px}.up.svelte-szi0e{background-color:var(--green)}.down.svelte-szi0e{background-color:var(--red)}.na.svelte-szi0e{background-color:var(--yellow)}.qa-container.svelte-1xv9cfi{border:2px solid var(--background);max-height:100%;overflow-y:auto}.chart-title.svelte-1oikip4{font-size:var(--smallText)}rect.svelte-1oikip4:hover{stroke:var(--black)}#stackedrect-holder.svelte-1oikip4{height:100%;width:100%}.axis-line.svelte-1oikip4{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-1oikip4{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-1oikip4{font-size:calc(var(--smallText) * .9)}.svelte-kz2qh6{transition:all .3s}.chart-title.svelte-kz2qh6{font-size:var(--smallText)}rect.svelte-kz2qh6:hover{stroke:var(--black)}.histogram-container.svelte-kz2qh6{height:100%;width:100%}.axis-line.svelte-kz2qh6{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-kz2qh6{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-kz2qh6{font-size:calc(var(--smallText) * .9)}.svelte-1pknxov{font-family:Lato}.card-container.svelte-1pknxov{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-1pknxov{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-1pknxov{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-1pknxov{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-1pknxov{font-size:.6em}text.svelte-1pknxov{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.card-container.svelte-mchgj2{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-mchgj2{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-mchgj2{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-mchgj2{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-mchgj2{font-size:.6em}text.svelte-mchgj2{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.ranked-chat.svelte-1nj8mt0.svelte-1nj8mt0{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.chat-input-holder.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;width:100%}.btnyousend.svelte-1nj8mt0.svelte-1nj8mt0{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-1nj8mt0.svelte-1nj8mt0{opacity:1}.instructions.svelte-1nj8mt0.svelte-1nj8mt0{text-align:center;padding:5%;border-right:var(--line)}.instructions.svelte-1nj8mt0 h5.svelte-1nj8mt0{text-align:left}.instructions.svelte-1nj8mt0 p.svelte-1nj8mt0{font-size:var(--smallText);text-align:left;margin:0}.instructions.svelte-1nj8mt0 button.svelte-1nj8mt0{font-size:var(--smallText)}.ranked-feedback-container.svelte-1nj8mt0.svelte-1nj8mt0{display:grid;grid-template-columns:20% 80%}.underline.svelte-1nj8mt0.svelte-1nj8mt0{border-bottom:var(--line)}.bold.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-1nj8mt0.svelte-1nj8mt0{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-1nj8mt0 .question.svelte-1nj8mt0{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-1nj8mt0 .answer.svelte-1nj8mt0{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}option.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:120%}p.svelte-1nj8mt0.svelte-1nj8mt0{margin:0}.svelte-1nna9rx{font-family:Lato}#chart-holder.svelte-1nna9rx{height:100%;width:100%}.axis-line.svelte-1nna9rx{stroke-width:3;stroke:#000;fill:none}.axis-tick.svelte-1nna9rx{stroke-width:2;stroke:#000;fill:none;opacity:.13}.axis-text.svelte-1nna9rx{font-family:Arial;font-size:12px}.bump-text.svelte-1nna9rx{font-size:12px;pointer-events:none}.model-path.svelte-1nna9rx{fill:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}.model-path-outer.svelte-1nna9rx{fill:none;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}.chart-subtitle.svelte-1nna9rx{font-size:12px}#bar-chart-holder.svelte-1y9gffu{height:100%;width:100%}.axis-text.svelte-1y9gffu{font-size:9px}.axis-line.svelte-1y9gffu{stroke-width:3;stroke:#000;fill:none}.label-text.svelte-1y9gffu{font-size:9px}.cell.svelte-hnulv9{max-height:40px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cell.active.svelte-hnulv9{max-height:100%;overflow:visible;white-space:normal}.svelte-owgjbp.svelte-owgjbp{font-family:Lato,monospace}.table.svelte-owgjbp.svelte-owgjbp{margin:auto;width:90%}.pretty-pager.svelte-owgjbp.svelte-owgjbp{padding-top:1rem}.pretty-table.normal.svelte-owgjbp.svelte-owgjbp{font-size:15px}.pretty-table.normal.svelte-owgjbp th.svelte-owgjbp,.pretty-table.normal.svelte-owgjbp td.svelte-owgjbp{padding:3px 2px}.pretty-table.svelte-owgjbp th.svelte-owgjbp,.pretty-table.svelte-owgjbp td.svelte-owgjbp{vertical-align:top}.pretty-table.svelte-owgjbp thead th.svelte-owgjbp{text-transform:uppercase;font-weight:700;font-family:Work Sans,sans-serif;border-bottom:2px solid black}.pretty-table.svelte-owgjbp th.svelte-owgjbp{cursor:pointer}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{text-align:right}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{font-family:menlo,consolas,monaco,monospace;font-size:90%}.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{padding-right:1em;color:#666}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse;table-layout:fixed}.pretty-table.svelte-owgjbp tr.svelte-owgjbp{border-bottom:1px solid #eee}td.active.svelte-owgjbp.svelte-owgjbp{max-height:100%;overflow:auto;color:red}td.svelte-owgjbp.svelte-owgjbp:not(.active){overflow:hidden;white-space:normal}tr.svelte-owgjbp.svelte-owgjbp:hover{background:#eee}.pretty-table.svelte-owgjbp.svelte-owgjbp{width:100%}#heatmap-holder.svelte-t6wv8i{height:100%;width:100%}.axis-text.svelte-t6wv8i,.chart-subtitle.svelte-t6wv8i{font-size:12px}.holder.svelte-7imt18.svelte-7imt18{height:100vh;width:100%;display:flex;justify-content:center;align-items:center}button.svelte-7imt18.svelte-7imt18{margin:0}.chart-captions.svelte-7imt18.svelte-7imt18{margin:auto;width:100%;text-align:left;height:100%}.chart-captions.svelte-7imt18 h4.svelte-7imt18{padding:0;margin:0}.main-container.svelte-7imt18.svelte-7imt18{margin:auto}.eval-container.svelte-7imt18.svelte-7imt18{display:grid;height:100vh;grid-template-rows:100%;grid-template-columns:65% 35%;padding:1rem}.left-charts.svelte-7imt18.svelte-7imt18{display:grid;grid-template-columns:100%;grid-template-rows:15% 60% 25%}.eval-table.svelte-7imt18.svelte-7imt18{margin:auto;width:100%}.right-charts.svelte-7imt18.svelte-7imt18{display:grid;grid-template-columns:100%;grid-template-rows:10% 33% 33%;gap:1%}.main-annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:90% 10%;height:100vh;width:100%;margin:auto}.buttons.svelte-3wjb3y.svelte-3wjb3y{display:flex;background:var(--grey)}.rating-button.svelte-3wjb3y.svelte-3wjb3y{padding:10px;border:none}.rating-button.svelte-3wjb3y+.rating-button.svelte-3wjb3y{margin-left:-1px}.ranked-chat.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:100%;border:var(--line);margin:12px}.chat-input-holder.svelte-3wjb3y.svelte-3wjb3y{align-items:center;width:100%;margin:auto;border-top:var(--line)}.instructions.svelte-3wjb3y.svelte-3wjb3y{text-align:center;padding:5%}.instructions.svelte-3wjb3y h5.svelte-3wjb3y{text-align:left}.instructions.svelte-3wjb3y p.svelte-3wjb3y{font-size:var(--smallText);text-align:left}.instructions.svelte-3wjb3y button.svelte-3wjb3y{font-size:var(--smallText)}.annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:40% 60%}.underline.svelte-3wjb3y.svelte-3wjb3y{border-bottom:var(--line)}.bold.svelte-3wjb3y.svelte-3wjb3y{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-message-center.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;padding:12px;box-sizing:border-box}.message-content.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;box-sizing:border-box;display:block}.message-content.svelte-3wjb3y .question.svelte-3wjb3y{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-3wjb3y .answer.svelte-3wjb3y{display:block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-3wjb3y .answers.svelte-3wjb3y{display:grid;grid-template-columns:100%;gap:2%;width:100%;margin:auto}svg.svelte-h2ab3o{background:conic-gradient(from 90deg at 1px 1px,#0000 90deg,rgba(0,0,0,.04) 0) 0 0/20px 20px;border:var(--line)}.file-circle-g.svelte-h2ab3o:hover{opacity:1}.bubble-file-text.svelte-h2ab3o{font-size:calc(.99 * var(--smallText));pointer-events:none;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill}circle.svelte-h2ab3o{transition:all .3s ease}circle.svelte-h2ab3o:hover{stroke:var(--black);stroke-width:3}.table-container.svelte-16fb3tv.svelte-16fb3tv{margin:auto;width:100%;overflow-y:scroll;max-height:100%;height:100%;overflow-y:auto}table.svelte-16fb3tv.svelte-16fb3tv{width:100%;border-collapse:collapse;font-size:var(--smallText)}thead.svelte-16fb3tv th.svelte-16fb3tv{text-align:center;padding:5px;border-bottom:4px solid var(--grey);background-color:var(--lightGrey)}thead.svelte-16fb3tv th.svelte-16fb3tv:nth-child(1){text-align:left}tbody.svelte-16fb3tv tr.svelte-16fb3tv{border-bottom:var(--line)}tbody.svelte-16fb3tv tr.svelte-16fb3tv:nth-child(2n){background-color:var(--white)}tbody.svelte-16fb3tv td.svelte-16fb3tv{padding:10px}.is-flex.svelte-16fb3tv.svelte-16fb3tv{display:flex;justify-content:space-between;align-items:center;padding:10px}.button.svelte-16fb3tv.svelte-16fb3tv{padding:5px 10px;border:none;cursor:pointer;transition:background-color .3s ease}.button.is-disabled.svelte-16fb3tv.svelte-16fb3tv{cursor:not-allowed;color:#ccc}.button.svelte-16fb3tv.svelte-16fb3tv:not(.is-disabled):hover{background-color:#f2f2f2}.button.is-white.svelte-16fb3tv.svelte-16fb3tv{color:#000}.mx-1.svelte-16fb3tv.svelte-16fb3tv{margin-left:1em;margin-right:1em}.file-container.svelte-1lu6hos{display:grid;height:calc(100% - var(--headerHeight));align-items:center;justify-content:center}.upload-container.svelte-1lu6hos{margin:auto;max-width:100%;text-align:center}.charts-container.svelte-1lu6hos{height:calc(100vh - var(--headerHeight));display:grid;gap:2%;grid-template-columns:100%;grid-template-rows:50% 40%}.data-grid.svelte-1lu6hos{display:grid;grid-template-columns:45% 50%;gap:0;margin:auto;max-width:1200px;padding-top:20px}.upload-box.svelte-1lu6hos{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;max-height:50vh;margin:auto;border:5px dashed var(--grey);padding:20px;box-sizing:border-box}.feedback-container.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:30% 70%;grid-template-rows:100%;width:90%;height:calc(100vh - var(--headerHeight))}.feedback-left.svelte-14znspc{border-bottom:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:25% 25% 25% 12.5% 12.5%}.left-text.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:100%;grid-template-columns:50% 50%}.left-confidence.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:40% 55%}.left-question.svelte-14znspc,.left-filter.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.feedback-right.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:30% 70%;grid-template-rows:0% 100%}.right-chart.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:50% 50%;grid-template-rows:100%}.right-chart-1.svelte-14znspc,.right-chart-2.svelte-14znspc{border-right:var(--line)}.right-table.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.card-1.svelte-14znspc{border-right:var(--line)}
diff --git a/pykoi/frontend/dist/assets/index-fb0d7a3f.js b/pykoi/frontend/dist/assets/index-6fbf13ee.js
similarity index 52%
rename from pykoi/frontend/dist/assets/index-fb0d7a3f.js
rename to pykoi/frontend/dist/assets/index-6fbf13ee.js
index 086f063..6563f6e 100644
--- a/pykoi/frontend/dist/assets/index-fb0d7a3f.js
+++ b/pykoi/frontend/dist/assets/index-6fbf13ee.js
@@ -1,31 +1,31 @@
-(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();function U(){}const Js=e=>e;function Sn(e,t){for(const n in t)e[n]=t[n];return e}function Zs(e){return e()}function Jl(){return Object.create(null)}function be(e){e.forEach(Zs)}function Ge(e){return typeof e=="function"}function fe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Fu(e){return Object.keys(e).length===0}function $l(e,...t){if(e==null)return U;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Du(e){let t;return $l(e,n=>t=n)(),t}function ue(e,t,n){e.$$.on_destroy.push($l(t,n))}function Uo(e,t,n,l){if(e){const o=ea(e,t,n,l);return e[0](o)}}function ea(e,t,n,l){return e[1]&&l?Sn(n.ctx.slice(),e[1](l(t))):n.ctx}function Wo(e,t,n,l){if(e[2]&&l){const o=e[2](l(n));if(t.dirty===void 0)return o;if(typeof o=="object"){const r=[],s=Math.max(t.dirty.length,o.length);for(let u=0;u32){const t=[],n=e.ctx.length/32;for(let l=0;lwindow.performance.now():()=>Date.now(),Mo=ta?e=>requestAnimationFrame(e):U;const Xt=new Set;function la(e){Xt.forEach(t=>{t.c(e)||(Xt.delete(t),t.f())}),Xt.size!==0&&Mo(la)}function oa(e){let t;return Xt.size===0&&Mo(la),{promise:new Promise(n=>{Xt.add(t={c:e,f:n})}),abort(){Xt.delete(t)}}}let Rl=!1;function Iu(){Rl=!0}function Nu(){Rl=!1}function Pu(e,t,n,l){for(;e>1);n(o)<=l?e=o+1:t=o}return e}function Tu(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const a=[];for(let f=0;f0&&t[n[o]].claim_order<=f?o+1:Pu(1,o,g=>t[n[g]].claim_order,f))-1;l[a]=n[c]+1;const d=c+1;n[d]=a,o=Math.max(d,o)}const r=[],s=[];let u=t.length-1;for(let a=n[o]+1;a!=0;a=l[a-1]){for(r.push(t[a-1]);u>=a;u--)s.push(t[u]);u--}for(;u>=0;u--)s.push(t[u]);r.reverse(),s.sort((a,f)=>a.claim_order-f.claim_order);for(let a=0,f=0;a=r[f].claim_order;)f++;const c=fe.removeEventListener(t,n,l)}function qu(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Hu(e){return function(t){t.target===this&&e.call(this,t)}}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Gu(e){return Array.from(e.childNodes)}function Bu(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function ju(e,t,n,l,o=!1){Bu(e);const r=(()=>{for(let s=e.claim_info.last_index;s=0;s--){const u=e[s];if(t(u)){const a=n(u);return a===void 0?e.splice(s,1):e[s]=a,o?a===void 0&&e.claim_info.last_index--:e.claim_info.last_index=s,u}}return l()})();return r.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,r}function xu(e,t){return ju(e,n=>n.nodeType===3,n=>{const l=""+t;if(n.data.startsWith(l)){if(n.data.length!==l.length)return n.splitText(l.length)}else n.data=l},()=>q(t),!0)}function K(e,t){t=""+t,e.data!==t&&(e.data=t)}function Ye(e,t){e.value=t??""}function Ae(e,t,n,l){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,l?"important":"")}function ll(e,t,n){for(let l=0;lonresize=function(){parent.postMessage(0,'*')}<\/script>",r=x(window,"message",s=>{s.source===l.contentWindow&&t()})):(l.src="about:blank",l.onload=()=>{r=x(l.contentWindow,"resize",t),t()}),b(e,l),()=>{(o||r&&l.contentWindow)&&r(),P(l)}}function Pt(e,t,n){e.classList[n?"add":"remove"](t)}function Wu(e,t,{bubbles:n=!1,cancelable:l=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,l,t),o}function Rt(e,t){return new e(t)}const ol=new Map;let il=0;function Xu(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Yu(e,t){const n={stylesheet:Ou(t),rules:{}};return ol.set(e,n),n}function Ko(e,t,n,l,o,r,s,u=0){const a=16.666/l;let f=`{
+(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();function U(){}const Zs=e=>e;function $n(e,t){for(const n in t)e[n]=t[n];return e}function ea(e){return e()}function Zl(){return Object.create(null)}function ve(e){e.forEach(ea)}function Ve(e){return typeof e=="function"}function fe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Iu(e){return Object.keys(e).length===0}function Al(e,...t){if(e==null)return U;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Nu(e){let t;return Al(e,n=>t=n)(),t}function ue(e,t,n){e.$$.on_destroy.push(Al(t,n))}function Uo(e,t,n,l){if(e){const o=ta(e,t,n,l);return e[0](o)}}function ta(e,t,n,l){return e[1]&&l?$n(n.ctx.slice(),e[1](l(t))):n.ctx}function Wo(e,t,n,l){if(e[2]&&l){const o=e[2](l(n));if(t.dirty===void 0)return o;if(typeof o=="object"){const r=[],s=Math.max(t.dirty.length,o.length);for(let u=0;u32){const t=[],n=e.ctx.length/32;for(let l=0;lwindow.performance.now():()=>Date.now(),Mo=na?e=>requestAnimationFrame(e):U;const Yt=new Set;function oa(e){Yt.forEach(t=>{t.c(e)||(Yt.delete(t),t.f())}),Yt.size!==0&&Mo(oa)}function ia(e){let t;return Yt.size===0&&Mo(oa),{promise:new Promise(n=>{Yt.add(t={c:e,f:n})}),abort(){Yt.delete(t)}}}let Rl=!1;function Pu(){Rl=!0}function Tu(){Rl=!1}function Ou(e,t,n,l){for(;e>1);n(o)<=l?e=o+1:t=o}return e}function Vu(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const a=[];for(let f=0;f0&&t[n[o]].claim_order<=f?o+1:Ou(1,o,p=>t[n[p]].claim_order,f))-1;l[a]=n[c]+1;const d=c+1;n[d]=a,o=Math.max(d,o)}const r=[],s=[];let u=t.length-1;for(let a=n[o]+1;a!=0;a=l[a-1]){for(r.push(t[a-1]);u>=a;u--)s.push(t[u]);u--}for(;u>=0;u--)s.push(t[u]);r.reverse(),s.sort((a,f)=>a.claim_order-f.claim_order);for(let a=0,f=0;a=r[f].claim_order;)f++;const c=fe.removeEventListener(t,n,l)}function Gu(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Bu(e){return function(t){t.target===this&&e.call(this,t)}}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ju(e){return Array.from(e.childNodes)}function xu(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Uu(e,t,n,l,o=!1){xu(e);const r=(()=>{for(let s=e.claim_info.last_index;s=0;s--){const u=e[s];if(t(u)){const a=n(u);return a===void 0?e.splice(s,1):e[s]=a,o?a===void 0&&e.claim_info.last_index--:e.claim_info.last_index=s,u}}return l()})();return r.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,r}function Wu(e,t){return Uu(e,n=>n.nodeType===3,n=>{const l=""+t;if(n.data.startsWith(l)){if(n.data.length!==l.length)return n.splitText(l.length)}else n.data=l},()=>q(t),!0)}function K(e,t){t=""+t,e.data!==t&&(e.data=t)}function Ye(e,t){e.value=t??""}function Re(e,t,n,l){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,l?"important":"")}function ol(e,t,n){for(let l=0;lonresize=function(){parent.postMessage(0,'*')}<\/script>",r=x(window,"message",s=>{s.source===l.contentWindow&&t()})):(l.src="about:blank",l.onload=()=>{r=x(l.contentWindow,"resize",t),t()}),b(e,l),()=>{(o||r&&l.contentWindow)&&r(),N(l)}}function Tt(e,t,n){e.classList[n?"add":"remove"](t)}function Yu(e,t,{bubbles:n=!1,cancelable:l=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,l,t),o}function At(e,t){return new e(t)}const il=new Map;let rl=0;function Qu(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Ku(e,t){const n={stylesheet:zu(t),rules:{}};return il.set(e,n),n}function Ko(e,t,n,l,o,r,s,u=0){const a=16.666/l;let f=`{
`;for(let v=0;v<=1;v+=a){const y=t+(n-t)*r(v);f+=v*100+`%{${s(y,1-y)}}
`}const c=f+`100% {${s(n,1-n)}}
-}`,d=`__svelte_${Xu(c)}_${u}`,g=ia(e),{stylesheet:p,rules:m}=ol.get(g)||Yu(g,e);m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${c}`,p.cssRules.length));const _=e.style.animation||"";return e.style.animation=`${_?`${_}, `:""}${d} ${l}ms linear ${o}ms 1 both`,il+=1,d}function Qu(e,t){const n=(e.style.animation||"").split(", "),l=n.filter(t?r=>r.indexOf(t)<0:r=>r.indexOf("__svelte")===-1),o=n.length-l.length;o&&(e.style.animation=l.join(", "),il-=o,il||Ku())}function Ku(){Mo(()=>{il||(ol.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&P(t)}),ol.clear())})}let Zt;function Ot(e){Zt=e}function Ju(){if(!Zt)throw new Error("Function called outside component initialization");return Zt}function ft(e){Ju().$$.on_mount.push(e)}function Zu(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(l=>l.call(this,t))}const xt=[],et=[];let Yt=[];const Zl=[],ef=Promise.resolve();let eo=!1;function tf(){eo||(eo=!0,ef.then(sa))}function Me(e){Yt.push(e)}function $n(e){Zl.push(e)}const El=new Set;let Ht=0;function sa(){if(Ht!==0)return;const e=Zt;do{try{for(;Hte.indexOf(l)===-1?t.push(l):n.push(l)),n.forEach(l=>l()),Yt=t}let sn;function of(){return sn||(sn=Promise.resolve(),sn.then(()=>{sn=null})),sn}function Fl(e,t,n){e.dispatchEvent(Wu(`${t?"intro":"outro"}${n}`))}const Qn=new Set;let dt;function we(){dt={r:0,c:[],p:dt}}function ye(){dt.r||be(dt.c),dt=dt.p}function V(e,t){e&&e.i&&(Qn.delete(e),e.i(t))}function z(e,t,n,l){if(e&&e.o){if(Qn.has(e))return;Qn.add(e),dt.c.push(()=>{Qn.delete(e),l&&(n&&e.d(1),l())}),e.o(t)}else l&&l()}const rf={duration:0};function lt(e,t,n,l){const o={direction:"both"};let r=t(e,n,o),s=l?0:1,u=null,a=null,f=null;function c(){f&&Qu(e,f)}function d(p,m){const _=p.b-s;return m*=Math.abs(_),{a:s,b:p.b,d:_,duration:m,start:p.start,end:p.start+m,group:p.group}}function g(p){const{delay:m=0,duration:_=300,easing:v=Js,tick:y=U,css:w}=r||rf,S={start:na()+m,b:p};p||(S.group=dt,dt.r+=1),u||a?a=S:(w&&(c(),f=Ko(e,s,p,_,m,v,w)),p&&y(0,1),u=d(S,_),Me(()=>Fl(e,p,"start")),oa(M=>{if(a&&M>a.start&&(u=d(a,_),a=null,Fl(e,u.b,"start"),w&&(c(),f=Ko(e,s,u.b,u.duration,0,v,r.css))),u){if(M>=u.end)y(s=u.b,1-s),Fl(e,u.b,"end"),a||(u.b?c():--u.group.r||be(u.group.c)),u=null;else if(M>=u.start){const $=M-u.start;s=u.a+u.d*v($/u.duration),y(s,1-s)}}return!!(u||a)}))}return{run(p){Ge(r)?of().then(()=>{r=r(o),g(p)}):g(p)},end(){c(),u=a=null}}}function zt(e,t){e.d(1),t.delete(e.key)}function aa(e,t){z(e,1,1,()=>{t.delete(e.key)})}function gt(e,t,n,l,o,r,s,u,a,f,c,d){let g=e.length,p=r.length,m=g;const _={};for(;m--;)_[e[m].key]=m;const v=[],y=new Map,w=new Map,S=[];for(m=p;m--;){const C=d(o,r,m),R=n(C);let k=s.get(R);k?l&&S.push(()=>k.p(C,t)):(k=f(R,C),k.c()),y.set(R,v[m]=k),R in _&&w.set(R,Math.abs(m-_[R]))}const M=new Set,$=new Set;function F(C){V(C,1),C.m(u,c),s.set(C.key,C),c=C.first,p--}for(;g&&p;){const C=v[p-1],R=e[g-1],k=C.key,E=R.key;C===R?(c=C.first,g--,p--):y.has(E)?!s.has(k)||M.has(k)?F(C):$.has(E)?g--:w.get(k)>w.get(E)?($.add(k),F(C)):(M.add(E),g--):(a(R,s),g--)}for(;g--;){const C=e[g];y.has(C.key)||a(C,s)}for(;p;)F(v[p-1]);return be(S),v}function ua(e,t){const n={},l={},o={$$scope:1};let r=e.length;for(;r--;){const s=e[r],u=t[r];if(u){for(const a in s)a in u||(l[a]=1);for(const a in u)o[a]||(n[a]=u[a],o[a]=1);e[r]=u}else for(const a in s)o[a]=1}for(const s in l)s in n||(n[s]=void 0);return n}function fa(e){return typeof e=="object"&&e!==null?e:{}}const sf=/[&"]/g,af=/[&<]/g;function uf(e,t=!1){const n=String(e),l=t?sf:af;l.lastIndex=0;let o="",r=0;for(;l.test(n);){const s=l.lastIndex-1,u=n[s];o+=n.substring(r,s)+(u==="&"?"&":u==='"'?""":"<"),r=s+1}return o+n.substring(r)}function ff(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let Dl;function ca(e){function t(n,l,o,r,s){const u=Zt,a={on_destroy:Dl,context:new Map(s||(u?u.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Jl()};Ot({$$:a});const f=e(n,l,o,r);return Ot(u),f}return{render:(n={},{$$slots:l={},context:o=new Map}={})=>{Dl=[];const r={title:"",head:"",css:new Set},s=t(r,n,{},l,o);return be(Dl),{html:s,css:{code:Array.from(r.css).map(u=>u.code).join(`
-`),map:null},head:r.title+r.head}},$$render:t}}function Rn(e,t,n){const l=e.$$.props[t];l!==void 0&&(e.$$.bound[l]=n,n(e.$$.ctx[l]))}function ne(e){e&&e.c()}function cf(e,t){e&&e.l(t)}function ee(e,t,n,l){const{fragment:o,after_update:r}=e.$$;o&&o.m(t,n),l||Me(()=>{const s=e.$$.on_mount.map(Zs).filter(Ge);e.$$.on_destroy?e.$$.on_destroy.push(...s):be(s),e.$$.on_mount=[]}),r.forEach(Me)}function te(e,t){const n=e.$$;n.fragment!==null&&(lf(n.after_update),be(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function df(e,t){e.$$.dirty[0]===-1&&(xt.push(e),tf(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const m=p.length?p[0]:g;return f.ctx&&o(f.ctx[d],f.ctx[d]=m)&&(!f.skip_bound&&f.bound[d]&&f.bound[d](m),c&&df(e,d)),g}):[],f.update(),c=!0,be(f.before_update),f.fragment=l?l(f.ctx):!1,t.target){if(t.hydrate){Iu();const d=Gu(t.target);f.fragment&&f.fragment.l(d),d.forEach(P)}else f.fragment&&f.fragment.c();t.intro&&V(e.$$.fragment),ee(e,t.target,t.anchor,t.customElement),Nu(),sa()}Ot(a)}class ce{$destroy(){te(this,1),this.$destroy=U}$on(t,n){if(!Ge(n))return U;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(n),()=>{const o=l.indexOf(n);o!==-1&&l.splice(o,1)}}$set(t){this.$$set&&!Fu(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Gt=[];function to(e,t){return{subscribe:De(e,t).subscribe}}function De(e,t=U){let n;const l=new Set;function o(u){if(fe(e,u)&&(e=u,n)){const a=!Gt.length;for(const f of l)f[1](),Gt.push(f,e);if(a){for(let f=0;f{l.delete(f),l.size===0&&n&&(n(),n=null)}}return{set:o,update:r,subscribe:s}}function hf(e,t,n){const l=!Array.isArray(e),o=l?[e]:e,r=t.length<2;return to(n,s=>{let u=!1;const a=[];let f=0,c=U;const d=()=>{if(f)return;c();const p=t(l?a[0]:a,s);r?s(p):c=Ge(p)?p:U},g=o.map((p,m)=>$l(p,_=>{a[m]=_,f&=~(1<{f|=1<e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const l=t.map((o,r)=>no(e[r],o));return o=>l.map(r=>r(o))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(Jo(e)&&Jo(t)){e=e.getTime(),t=t.getTime();const r=t-e;return s=>new Date(e+s*r)}const l=Object.keys(t),o={};return l.forEach(r=>{o[r]=no(e[r],t[r])}),r=>{const s={};return l.forEach(u=>{s[u]=o[u](r)}),s}}if(n==="number"){const l=t-e;return o=>e+o*l}throw new Error(`Cannot interpolate ${n} values`)}function Fo(e,t={}){const n=De(e);let l,o=e;function r(s,u){if(e==null)return n.set(e=s),Promise.resolve();o=s;let a=l,f=!1,{delay:c=0,duration:d=400,easing:g=Js,interpolate:p=no}=Sn(Sn({},t),u);if(d===0)return a&&(a.abort(),a=null),n.set(e=o),Promise.resolve();const m=na()+c;let _;return l=oa(v=>{if(vd?(n.set(e=s),!1):(n.set(e=_(g(y/d))),!0)}),l.promise}return{set:r,update:(s,u)=>r(s(o,e),u),subscribe:n.subscribe}}const qe=De([]),Il=De([]),an=De([]),An=De([]),st=De("all"),Zo=De({"n/a":1,up:1,down:1}),gf=["who","what","how","why","where","does","can","n/a"],lo=Fo(gf.map(e=>({question:e,count:0}))),oo=De(new Set);var io="http://www.w3.org/1999/xhtml";const ei={svg:"http://www.w3.org/2000/svg",xhtml:io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function da(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ei.hasOwnProperty(t)?{space:ei[t],local:e}:e}function pf(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===io&&t.documentElement.namespaceURI===io?t.createElement(e):t.createElementNS(n,e)}}function mf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ha(e){var t=da(e);return(t.local?mf:pf)(t)}function _f(){}function ga(e){return e==null?_f:function(){return this.querySelector(e)}}function vf(e){typeof e!="function"&&(e=ga(e));for(var t=this._groups,n=t.length,l=new Array(n),o=0;o=S&&(S=w+1);!($=v[S])&&++S=0;)(s=l[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function jf(e){e||(e=xf);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var n=this._groups,l=n.length,o=new Array(l),r=0;rt?1:e>=t?0:NaN}function Uf(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Wf(){return Array.from(this)}function Xf(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?ic:typeof t=="function"?sc:rc)(e,t,n??"")):uc(this.node(),e)}function uc(e,t){return e.style.getPropertyValue(t)||va(e).getComputedStyle(e,null).getPropertyValue(t)}function fc(e){return function(){delete this[e]}}function cc(e,t){return function(){this[e]=t}}function dc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function hc(e,t){return arguments.length>1?this.each((t==null?fc:typeof t=="function"?dc:cc)(e,t)):this.node()[e]}function ba(e){return e.trim().split(/^|\s+/)}function Do(e){return e.classList||new wa(e)}function wa(e){this._node=e,this._names=ba(e.getAttribute("class")||"")}wa.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ya(e,t){for(var n=Do(e),l=-1,o=t.length;++l=0&&(n=t.slice(l+1),t=t.slice(0,l)),{type:t,name:n}})}function Hc(e){return function(){var t=this.__on;if(t){for(var n=0,l=-1,o=t.length,r;n({}),ti=e=>({});function Qc(e){let t,n,l,o,r,s,u,a,f;const c=e[4].header,d=Uo(c,e,e[3],ti),g=e[4].default,p=Uo(g,e,e[3],null);return{c(){t=A("dialog"),n=A("div"),l=A("div"),o=A("button"),o.textContent="X",r=N(),d&&d.c(),s=N(),p&&p.c(),h(o,"class","close-button svelte-g384pz"),h(l,"class","btn-container svelte-g384pz"),h(n,"class","svelte-g384pz"),h(t,"class","svelte-g384pz")},m(m,_){T(m,t,_),b(t,n),b(n,l),b(l,o),b(n,r),d&&d.m(n,null),b(n,s),p&&p.m(n,null),e[6](t),u=!0,a||(f=[x(o,"click",function(){Ge(e[1])&&e[1].apply(this,arguments)}),x(n,"click",qu(e[5])),x(t,"close",function(){Ge(e[1])&&e[1].apply(this,arguments)}),x(t,"click",Hu(function(){Ge(e[1])&&e[1].apply(this,arguments)}))],a=!0)},p(m,[_]){e=m,d&&d.p&&(!u||_&8)&&Xo(d,c,e,e[3],u?Wo(c,e[3],_,Yc):Yo(e[3]),ti),p&&p.p&&(!u||_&8)&&Xo(p,g,e,e[3],u?Wo(g,e[3],_,null):Yo(e[3]),null)},i(m){u||(V(d,m),V(p,m),u=!0)},o(m){z(d,m),z(p,m),u=!1},d(m){m&&P(t),d&&d.d(m),p&&p.d(m),e[6](null),a=!1,be(f)}}}function Kc(e,t,n){let{$$slots:l={},$$scope:o}=t,{showModal:r}=t,{dialog:s}=t,{handleClose:u}=t;function a(c){Zu.call(this,e,c)}function f(c){et[c?"unshift":"push"](()=>{s=c,n(0,s)})}return e.$$set=c=>{"showModal"in c&&n(2,r=c.showModal),"dialog"in c&&n(0,s=c.dialog),"handleClose"in c&&n(1,u=c.handleClose),"$$scope"in c&&n(3,o=c.$$scope)},e.$$.update=()=>{e.$$.dirty&5&&s&&r&&s.showModal()},[s,u,r,o,l,a,f]}class Jc extends ce{constructor(t){super(),de(this,t,Kc,Qc,fe,{showModal:2,dialog:0,handleClose:1})}}function ni(e){let t,n,l,o,r,s,u,a,f;return{c(){t=A("form"),n=A("div"),l=A("label"),l.textContent="Filename",o=N(),r=A("input"),s=N(),u=A("div"),u.innerHTML='',h(l,"for","file_name"),h(l,"class","svelte-sy2m0x"),h(r,"type","text"),h(r,"placeholder","Please enter filename"),h(r,"name","file_name"),r.required=!0,h(n,"class","inputs svelte-sy2m0x"),h(u,"class","btn-container svelte-sy2m0x")},m(c,d){T(c,t,d),b(t,n),b(n,l),b(n,o),b(n,r),Ye(r,e[2]),b(t,s),b(t,u),a||(f=[x(r,"input",e[9]),x(t,"submit",e[6])],a=!0)},p(c,d){d&4&&r.value!==c[2]&&Ye(r,c[2])},d(c){c&&P(t),a=!1,be(f)}}}function li(e){let t,n,l,o,r,s,u,a,f;return{c(){t=A("div"),n=q("✅ Data downloaded to /pykoi/"),l=q(e[2]),o=q(".csv"),r=N(),s=A("div"),u=A("button"),u.textContent="Close",h(s,"class","btn-container svelte-sy2m0x")},m(c,d){T(c,t,d),b(t,n),b(t,l),b(t,o),T(c,r,d),T(c,s,d),b(s,u),a||(f=x(u,"click",e[7]),a=!0)},p(c,d){d&4&&K(l,c[2])},d(c){c&&P(t),c&&P(r),c&&P(s),a=!1,f()}}}function oi(e){let t,n,l,o,r,s,u,a;return{c(){t=A("div"),t.textContent="⚠️ Download failed. Please try again.",n=N(),l=A("div"),o=A("button"),o.textContent="Retry",r=N(),s=A("button"),s.textContent="Close",h(l,"class","btn-container svelte-sy2m0x")},m(f,c){T(f,t,c),T(f,n,c),T(f,l,c),b(l,o),b(l,r),b(l,s),u||(a=[x(o,"click",e[10]),x(s,"click",e[7])],u=!0)},p:U,d(f){f&&P(t),f&&P(n),f&&P(l),u=!1,be(a)}}}function ii(e){let t,n,l,o,r,s,u,a,f,c,d;return{c(){t=A("div"),n=q("⚠️ "),l=q(e[2]),o=q(".csv already exists. Do you wish to overwrite it?"),r=N(),s=A("div"),u=A("button"),u.textContent="Back",a=N(),f=A("button"),f.textContent="Overwrite",h(s,"class","btn-container svelte-sy2m0x")},m(g,p){T(g,t,p),b(t,n),b(t,l),b(t,o),T(g,r,p),T(g,s,p),b(s,u),b(s,a),b(s,f),c||(d=[x(u,"click",e[11]),x(f,"click",e[12])],c=!0)},p(g,p){p&4&&K(l,g[2])},d(g){g&&P(t),g&&P(r),g&&P(s),c=!1,be(d)}}}function Zc(e){let t,n,l,o,r=e[3]===e[4].FILE_INPUT&&ni(e),s=e[3]===e[4].DOWNLOADED&&li(e),u=e[3]===e[4].FAILED_DOWNLOAD&&oi(e),a=e[3]===e[4].OVERWRITE&&ii(e);return{c(){r&&r.c(),t=N(),s&&s.c(),n=N(),u&&u.c(),l=N(),a&&a.c(),o=Se()},m(f,c){r&&r.m(f,c),T(f,t,c),s&&s.m(f,c),T(f,n,c),u&&u.m(f,c),T(f,l,c),a&&a.m(f,c),T(f,o,c)},p(f,c){f[3]===f[4].FILE_INPUT?r?r.p(f,c):(r=ni(f),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),f[3]===f[4].DOWNLOADED?s?s.p(f,c):(s=li(f),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),f[3]===f[4].FAILED_DOWNLOAD?u?u.p(f,c):(u=oi(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),f[3]===f[4].OVERWRITE?a?a.p(f,c):(a=ii(f),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(f){r&&r.d(f),f&&P(t),s&&s.d(f),f&&P(n),u&&u.d(f),f&&P(l),a&&a.d(f),f&&P(o)}}}function ed(e){let t;return{c(){t=A("h4"),t.textContent="Download Data",h(t,"slot","header"),h(t,"class","svelte-sy2m0x")},m(n,l){T(n,t,l)},p:U,d(n){n&&P(t)}}}function td(e){let t,n,l,o;function r(a){e[13](a)}function s(a){e[14](a)}let u={handleClose:e[7],$$slots:{header:[ed],default:[Zc]},$$scope:{ctx:e}};return e[0]!==void 0&&(u.showModal=e[0]),e[1]!==void 0&&(u.dialog=e[1]),t=new Jc({props:u}),et.push(()=>Rn(t,"showModal",r)),et.push(()=>Rn(t,"dialog",s)),{c(){ne(t.$$.fragment)},m(a,f){ee(t,a,f),o=!0},p(a,[f]){const c={};f&32780&&(c.$$scope={dirty:f,ctx:a}),!n&&f&1&&(n=!0,c.showModal=a[0],$n(()=>n=!1)),!l&&f&2&&(l=!0,c.dialog=a[1],$n(()=>l=!1)),t.$set(c)},i(a){o||(V(t.$$.fragment,a),o=!0)},o(a){z(t.$$.fragment,a),o=!1},d(a){te(t,a)}}}function nd(e,t,n){let{showModal:l,table:o}=t,r,s="";const u={FILE_INPUT:0,DOWNLOADED:1,FAILED_DOWNLOAD:2,OVERWRITE:3};let a=u.FILE_INPUT;const f=async w=>{const S={file_name:w},$=await(await fetch(`/chat/${o}/save_to_csv`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)})).json();console.log("Download Complete: ",$),$.status==="200"?(console.log("success"),n(3,a=u.DOWNLOADED)):(console.log("failed"),n(3,a=u.FAILED_DOWNLOAD))},c=async w=>{w.preventDefault();const S=await fetch(`/file_exists/?file_name=${s}.csv`),{file_exists:M}=await S.json();M===!0?n(3,a=u.OVERWRITE):f(s)};function d(){n(0,l=!1),n(3,a=u.FILE_INPUT),r.close()}function g(){s=this.value,n(2,s)}const p=()=>n(3,a=u.FILE_INPUT),m=()=>n(3,a=u.FILE_INPUT),_=()=>f(s);function v(w){l=w,n(0,l)}function y(w){r=w,n(1,r)}return e.$$set=w=>{"showModal"in w&&n(0,l=w.showModal),"table"in w&&n(8,o=w.table)},[l,r,s,a,u,f,c,d,o,g,p,m,_,v,y]}class Io extends ce{constructor(t){super(),de(this,t,nd,td,fe,{showModal:0,table:8})}}function ri(e,t,n){const l=e.slice();return l[19]=t[n],l[21]=n,l}function si(e){let t,n,l,o,r,s;function u(...f){return e[12](e[21],...f)}function a(...f){return e[13](e[21],...f)}return{c(){t=A("div"),n=A("button"),n.textContent="👍",l=N(),o=A("button"),o.textContent="👎",h(n,"class","small-button thumbs-up svelte-19cad35"),h(o,"class","small-button thumbs-down svelte-19cad35"),h(t,"class","feedback-buttons svelte-19cad35")},m(f,c){T(f,t,c),b(t,n),b(t,l),b(t,o),r||(s=[x(n,"click",u),x(o,"click",a)],r=!0)},p(f,c){e=f},d(f){f&&P(t),r=!1,be(s)}}}function ai(e,t){let n,l,o,r,s,u,a,f,c,d=t[19].question+"",g,p,m,_,v,y,w,S=t[19].answer+"",M,$,F,C,R,k,E=t[0]&&si(t);return{key:e,first:null,c(){n=A("div"),l=A("div"),o=A("div"),r=N(),s=A("div"),u=A("div"),a=A("h5"),a.textContent="Question:",f=N(),c=A("p"),g=q(d),p=N(),m=A("div"),_=A("div"),v=A("h5"),v.textContent="Response:",y=N(),w=A("p"),M=q(S),$=N(),E&&E.c(),F=N(),h(o,"class","avatar"),h(a,"class","bold svelte-19cad35"),h(u,"class","question svelte-19cad35"),h(v,"class","bold svelte-19cad35"),h(_,"class","answer svelte-19cad35"),h(m,"class","answers svelte-19cad35"),h(s,"class","message-content svelte-19cad35"),h(l,"class","chat-message-center svelte-19cad35"),h(n,"class","chat-message svelte-19cad35"),this.first=n},m(I,D){T(I,n,D),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,g),b(s,p),b(s,m),b(m,_),b(_,v),b(_,y),b(_,w),b(w,M),b(_,$),E&&E.m(_,null),b(n,F),R||(k=Cn(C=od.call(null,n,t[21]===t[5].length-1)),R=!0)},p(I,D){t=I,D&32&&d!==(d=t[19].question+"")&&K(g,d),D&32&&S!==(S=t[19].answer+"")&&K(M,S),t[0]?E?E.p(t,D):(E=si(t),E.c(),E.m(_,null)):E&&(E.d(1),E=null),C&&Ge(C.update)&&D&32&&C.update.call(null,t[21]===t[5].length-1)},d(I){I&&P(n),E&&E.d(),R=!1,k()}}}function ld(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_=[],v=new Map,y,w,S,M,$,F,C=(e[3]?e[4]:"Send")+"",R,k,E,I,D,L,O;function B(W){e[11](W)}let j={table:"qa_table"};e[1]!==void 0&&(j.showModal=e[1]),t=new Io({props:j}),et.push(()=>Rn(t,"showModal",B));let ae=e[5];const pe=W=>W[21];for(let W=0;Wr.indexOf(t)<0:r=>r.indexOf("__svelte")===-1),o=n.length-l.length;o&&(e.style.animation=l.join(", "),rl-=o,rl||Zu())}function Zu(){Mo(()=>{rl||(il.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&N(t)}),il.clear())})}let tn;function Vt(e){tn=e}function ef(){if(!tn)throw new Error("Function called outside component initialization");return tn}function ft(e){ef().$$.on_mount.push(e)}function tf(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(l=>l.call(this,t))}const Ut=[],et=[];let Qt=[];const eo=[],nf=Promise.resolve();let to=!1;function lf(){to||(to=!0,nf.then(aa))}function Me(e){Qt.push(e)}function An(e){eo.push(e)}const Fl=new Set;let Gt=0;function aa(){if(Gt!==0)return;const e=tn;do{try{for(;Gte.indexOf(l)===-1?t.push(l):n.push(l)),n.forEach(l=>l()),Qt=t}let un;function sf(){return un||(un=Promise.resolve(),un.then(()=>{un=null})),un}function Dl(e,t,n){e.dispatchEvent(Yu(`${t?"intro":"outro"}${n}`))}const Kn=new Set;let dt;function we(){dt={r:0,c:[],p:dt}}function ye(){dt.r||ve(dt.c),dt=dt.p}function V(e,t){e&&e.i&&(Kn.delete(e),e.i(t))}function z(e,t,n,l){if(e&&e.o){if(Kn.has(e))return;Kn.add(e),dt.c.push(()=>{Kn.delete(e),l&&(n&&e.d(1),l())}),e.o(t)}else l&&l()}const af={duration:0};function lt(e,t,n,l){const o={direction:"both"};let r=t(e,n,o),s=l?0:1,u=null,a=null,f=null;function c(){f&&Ju(e,f)}function d(g,m){const _=g.b-s;return m*=Math.abs(_),{a:s,b:g.b,d:_,duration:m,start:g.start,end:g.start+m,group:g.group}}function p(g){const{delay:m=0,duration:_=300,easing:v=Zs,tick:y=U,css:w}=r||af,S={start:la()+m,b:g};g||(S.group=dt,dt.r+=1),u||a?a=S:(w&&(c(),f=Ko(e,s,g,_,m,v,w)),g&&y(0,1),u=d(S,_),Me(()=>Dl(e,g,"start")),ia(M=>{if(a&&M>a.start&&(u=d(a,_),a=null,Dl(e,u.b,"start"),w&&(c(),f=Ko(e,s,u.b,u.duration,0,v,r.css))),u){if(M>=u.end)y(s=u.b,1-s),Dl(e,u.b,"end"),a||(u.b?c():--u.group.r||ve(u.group.c)),u=null;else if(M>=u.start){const $=M-u.start;s=u.a+u.d*v($/u.duration),y(s,1-s)}}return!!(u||a)}))}return{run(g){Ve(r)?sf().then(()=>{r=r(o),p(g)}):p(g)},end(){c(),u=a=null}}}function Lt(e,t){e.d(1),t.delete(e.key)}function ua(e,t){z(e,1,1,()=>{t.delete(e.key)})}function gt(e,t,n,l,o,r,s,u,a,f,c,d){let p=e.length,g=r.length,m=p;const _={};for(;m--;)_[e[m].key]=m;const v=[],y=new Map,w=new Map,S=[];for(m=g;m--;){const C=d(o,r,m),R=n(C);let k=s.get(R);k?l&&S.push(()=>k.p(C,t)):(k=f(R,C),k.c()),y.set(R,v[m]=k),R in _&&w.set(R,Math.abs(m-_[R]))}const M=new Set,$=new Set;function F(C){V(C,1),C.m(u,c),s.set(C.key,C),c=C.first,g--}for(;p&&g;){const C=v[g-1],R=e[p-1],k=C.key,E=R.key;C===R?(c=C.first,p--,g--):y.has(E)?!s.has(k)||M.has(k)?F(C):$.has(E)?p--:w.get(k)>w.get(E)?($.add(k),F(C)):(M.add(E),p--):(a(R,s),p--)}for(;p--;){const C=e[p];y.has(C.key)||a(C,s)}for(;g;)F(v[g-1]);return ve(S),v}function fa(e,t){const n={},l={},o={$$scope:1};let r=e.length;for(;r--;){const s=e[r],u=t[r];if(u){for(const a in s)a in u||(l[a]=1);for(const a in u)o[a]||(n[a]=u[a],o[a]=1);e[r]=u}else for(const a in s)o[a]=1}for(const s in l)s in n||(n[s]=void 0);return n}function ca(e){return typeof e=="object"&&e!==null?e:{}}const uf=/[&"]/g,ff=/[&<]/g;function cf(e,t=!1){const n=String(e),l=t?uf:ff;l.lastIndex=0;let o="",r=0;for(;l.test(n);){const s=l.lastIndex-1,u=n[s];o+=n.substring(r,s)+(u==="&"?"&":u==='"'?""":"<"),r=s+1}return o+n.substring(r)}function df(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let Il;function da(e){function t(n,l,o,r,s){const u=tn,a={on_destroy:Il,context:new Map(s||(u?u.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Zl()};Vt({$$:a});const f=e(n,l,o,r);return Vt(u),f}return{render:(n={},{$$slots:l={},context:o=new Map}={})=>{Il=[];const r={title:"",head:"",css:new Set},s=t(r,n,{},l,o);return ve(Il),{html:s,css:{code:Array.from(r.css).map(u=>u.code).join(`
+`),map:null},head:r.title+r.head}},$$render:t}}function Rn(e,t,n){const l=e.$$.props[t];l!==void 0&&(e.$$.bound[l]=n,n(e.$$.ctx[l]))}function ne(e){e&&e.c()}function hf(e,t){e&&e.l(t)}function ee(e,t,n,l){const{fragment:o,after_update:r}=e.$$;o&&o.m(t,n),l||Me(()=>{const s=e.$$.on_mount.map(ea).filter(Ve);e.$$.on_destroy?e.$$.on_destroy.push(...s):ve(s),e.$$.on_mount=[]}),r.forEach(Me)}function te(e,t){const n=e.$$;n.fragment!==null&&(rf(n.after_update),ve(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function gf(e,t){e.$$.dirty[0]===-1&&(Ut.push(e),lf(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const m=g.length?g[0]:p;return f.ctx&&o(f.ctx[d],f.ctx[d]=m)&&(!f.skip_bound&&f.bound[d]&&f.bound[d](m),c&&gf(e,d)),p}):[],f.update(),c=!0,ve(f.before_update),f.fragment=l?l(f.ctx):!1,t.target){if(t.hydrate){Pu();const d=ju(t.target);f.fragment&&f.fragment.l(d),d.forEach(N)}else f.fragment&&f.fragment.c();t.intro&&V(e.$$.fragment),ee(e,t.target,t.anchor,t.customElement),Tu(),aa()}Vt(a)}class ce{$destroy(){te(this,1),this.$destroy=U}$on(t,n){if(!Ve(n))return U;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(n),()=>{const o=l.indexOf(n);o!==-1&&l.splice(o,1)}}$set(t){this.$$set&&!Iu(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Bt=[];function no(e,t){return{subscribe:Ie(e,t).subscribe}}function Ie(e,t=U){let n;const l=new Set;function o(u){if(fe(e,u)&&(e=u,n)){const a=!Bt.length;for(const f of l)f[1](),Bt.push(f,e);if(a){for(let f=0;f{l.delete(f),l.size===0&&n&&(n(),n=null)}}return{set:o,update:r,subscribe:s}}function pf(e,t,n){const l=!Array.isArray(e),o=l?[e]:e,r=t.length<2;return no(n,s=>{let u=!1;const a=[];let f=0,c=U;const d=()=>{if(f)return;c();const g=t(l?a[0]:a,s);r?s(g):c=Ve(g)?g:U},p=o.map((g,m)=>Al(g,_=>{a[m]=_,f&=~(1<{f|=1<e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const l=t.map((o,r)=>lo(e[r],o));return o=>l.map(r=>r(o))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(Jo(e)&&Jo(t)){e=e.getTime(),t=t.getTime();const r=t-e;return s=>new Date(e+s*r)}const l=Object.keys(t),o={};return l.forEach(r=>{o[r]=lo(e[r],t[r])}),r=>{const s={};return l.forEach(u=>{s[u]=o[u](r)}),s}}if(n==="number"){const l=t-e;return o=>e+o*l}throw new Error(`Cannot interpolate ${n} values`)}function Fo(e,t={}){const n=Ie(e);let l,o=e;function r(s,u){if(e==null)return n.set(e=s),Promise.resolve();o=s;let a=l,f=!1,{delay:c=0,duration:d=400,easing:p=Zs,interpolate:g=lo}=$n($n({},t),u);if(d===0)return a&&(a.abort(),a=null),n.set(e=o),Promise.resolve();const m=la()+c;let _;return l=ia(v=>{if(vd?(n.set(e=s),!1):(n.set(e=_(p(y/d))),!0)}),l.promise}return{set:r,update:(s,u)=>r(s(o,e),u),subscribe:n.subscribe}}const He=Ie([]),Nl=Ie([]),fn=Ie([]),Mn=Ie([]),st=Ie("all"),Zo=Ie({"n/a":1,up:1,down:1}),mf=["who","what","how","why","where","does","can","n/a"],oo=Fo(mf.map(e=>({question:e,count:0}))),It=Ie(new Set);var io="http://www.w3.org/1999/xhtml";const ei={svg:"http://www.w3.org/2000/svg",xhtml:io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ha(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ei.hasOwnProperty(t)?{space:ei[t],local:e}:e}function _f(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===io&&t.documentElement.namespaceURI===io?t.createElement(e):t.createElementNS(n,e)}}function vf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ga(e){var t=ha(e);return(t.local?vf:_f)(t)}function bf(){}function pa(e){return e==null?bf:function(){return this.querySelector(e)}}function wf(e){typeof e!="function"&&(e=pa(e));for(var t=this._groups,n=t.length,l=new Array(n),o=0;o=S&&(S=w+1);!($=v[S])&&++S=0;)(s=l[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function Uf(e){e||(e=Wf);function t(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var n=this._groups,l=n.length,o=new Array(l),r=0;rt?1:e>=t?0:NaN}function Xf(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Yf(){return Array.from(this)}function Qf(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?sc:typeof t=="function"?uc:ac)(e,t,n??"")):cc(this.node(),e)}function cc(e,t){return e.style.getPropertyValue(t)||ba(e).getComputedStyle(e,null).getPropertyValue(t)}function dc(e){return function(){delete this[e]}}function hc(e,t){return function(){this[e]=t}}function gc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function pc(e,t){return arguments.length>1?this.each((t==null?dc:typeof t=="function"?gc:hc)(e,t)):this.node()[e]}function wa(e){return e.trim().split(/^|\s+/)}function Do(e){return e.classList||new ya(e)}function ya(e){this._node=e,this._names=wa(e.getAttribute("class")||"")}ya.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ka(e,t){for(var n=Do(e),l=-1,o=t.length;++l=0&&(n=t.slice(l+1),t=t.slice(0,l)),{type:t,name:n}})}function Bc(e){return function(){var t=this.__on;if(t){for(var n=0,l=-1,o=t.length,r;n({}),ti=e=>({});function Jc(e){let t,n,l,o,r,s,u,a,f;const c=e[4].header,d=Uo(c,e,e[3],ti),p=e[4].default,g=Uo(p,e,e[3],null);return{c(){t=A("dialog"),n=A("div"),l=A("div"),o=A("button"),o.textContent="X",r=P(),d&&d.c(),s=P(),g&&g.c(),h(o,"class","close-button svelte-g384pz"),h(l,"class","btn-container svelte-g384pz"),h(n,"class","svelte-g384pz"),h(t,"class","svelte-g384pz")},m(m,_){T(m,t,_),b(t,n),b(n,l),b(l,o),b(n,r),d&&d.m(n,null),b(n,s),g&&g.m(n,null),e[6](t),u=!0,a||(f=[x(o,"click",function(){Ve(e[1])&&e[1].apply(this,arguments)}),x(n,"click",Gu(e[5])),x(t,"close",function(){Ve(e[1])&&e[1].apply(this,arguments)}),x(t,"click",Bu(function(){Ve(e[1])&&e[1].apply(this,arguments)}))],a=!0)},p(m,[_]){e=m,d&&d.p&&(!u||_&8)&&Xo(d,c,e,e[3],u?Wo(c,e[3],_,Kc):Yo(e[3]),ti),g&&g.p&&(!u||_&8)&&Xo(g,p,e,e[3],u?Wo(p,e[3],_,null):Yo(e[3]),null)},i(m){u||(V(d,m),V(g,m),u=!0)},o(m){z(d,m),z(g,m),u=!1},d(m){m&&N(t),d&&d.d(m),g&&g.d(m),e[6](null),a=!1,ve(f)}}}function Zc(e,t,n){let{$$slots:l={},$$scope:o}=t,{showModal:r}=t,{dialog:s}=t,{handleClose:u}=t;function a(c){tf.call(this,e,c)}function f(c){et[c?"unshift":"push"](()=>{s=c,n(0,s)})}return e.$$set=c=>{"showModal"in c&&n(2,r=c.showModal),"dialog"in c&&n(0,s=c.dialog),"handleClose"in c&&n(1,u=c.handleClose),"$$scope"in c&&n(3,o=c.$$scope)},e.$$.update=()=>{e.$$.dirty&5&&s&&r&&s.showModal()},[s,u,r,o,l,a,f]}class ed extends ce{constructor(t){super(),de(this,t,Zc,Jc,fe,{showModal:2,dialog:0,handleClose:1})}}function ni(e){let t,n,l,o,r,s,u,a,f;return{c(){t=A("form"),n=A("div"),l=A("label"),l.textContent="Filename",o=P(),r=A("input"),s=P(),u=A("div"),u.innerHTML='',h(l,"for","file_name"),h(l,"class","svelte-sy2m0x"),h(r,"type","text"),h(r,"placeholder","Please enter filename"),h(r,"name","file_name"),r.required=!0,h(n,"class","inputs svelte-sy2m0x"),h(u,"class","btn-container svelte-sy2m0x")},m(c,d){T(c,t,d),b(t,n),b(n,l),b(n,o),b(n,r),Ye(r,e[2]),b(t,s),b(t,u),a||(f=[x(r,"input",e[9]),x(t,"submit",e[6])],a=!0)},p(c,d){d&4&&r.value!==c[2]&&Ye(r,c[2])},d(c){c&&N(t),a=!1,ve(f)}}}function li(e){let t,n,l,o,r,s,u,a,f;return{c(){t=A("div"),n=q("✅ Data downloaded to /pykoi/"),l=q(e[2]),o=q(".csv"),r=P(),s=A("div"),u=A("button"),u.textContent="Close",h(s,"class","btn-container svelte-sy2m0x")},m(c,d){T(c,t,d),b(t,n),b(t,l),b(t,o),T(c,r,d),T(c,s,d),b(s,u),a||(f=x(u,"click",e[7]),a=!0)},p(c,d){d&4&&K(l,c[2])},d(c){c&&N(t),c&&N(r),c&&N(s),a=!1,f()}}}function oi(e){let t,n,l,o,r,s,u,a;return{c(){t=A("div"),t.textContent="⚠️ Download failed. Please try again.",n=P(),l=A("div"),o=A("button"),o.textContent="Retry",r=P(),s=A("button"),s.textContent="Close",h(l,"class","btn-container svelte-sy2m0x")},m(f,c){T(f,t,c),T(f,n,c),T(f,l,c),b(l,o),b(l,r),b(l,s),u||(a=[x(o,"click",e[10]),x(s,"click",e[7])],u=!0)},p:U,d(f){f&&N(t),f&&N(n),f&&N(l),u=!1,ve(a)}}}function ii(e){let t,n,l,o,r,s,u,a,f,c,d;return{c(){t=A("div"),n=q("⚠️ "),l=q(e[2]),o=q(".csv already exists. Do you wish to overwrite it?"),r=P(),s=A("div"),u=A("button"),u.textContent="Back",a=P(),f=A("button"),f.textContent="Overwrite",h(s,"class","btn-container svelte-sy2m0x")},m(p,g){T(p,t,g),b(t,n),b(t,l),b(t,o),T(p,r,g),T(p,s,g),b(s,u),b(s,a),b(s,f),c||(d=[x(u,"click",e[11]),x(f,"click",e[12])],c=!0)},p(p,g){g&4&&K(l,p[2])},d(p){p&&N(t),p&&N(r),p&&N(s),c=!1,ve(d)}}}function td(e){let t,n,l,o,r=e[3]===e[4].FILE_INPUT&&ni(e),s=e[3]===e[4].DOWNLOADED&&li(e),u=e[3]===e[4].FAILED_DOWNLOAD&&oi(e),a=e[3]===e[4].OVERWRITE&&ii(e);return{c(){r&&r.c(),t=P(),s&&s.c(),n=P(),u&&u.c(),l=P(),a&&a.c(),o=Se()},m(f,c){r&&r.m(f,c),T(f,t,c),s&&s.m(f,c),T(f,n,c),u&&u.m(f,c),T(f,l,c),a&&a.m(f,c),T(f,o,c)},p(f,c){f[3]===f[4].FILE_INPUT?r?r.p(f,c):(r=ni(f),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),f[3]===f[4].DOWNLOADED?s?s.p(f,c):(s=li(f),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),f[3]===f[4].FAILED_DOWNLOAD?u?u.p(f,c):(u=oi(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),f[3]===f[4].OVERWRITE?a?a.p(f,c):(a=ii(f),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(f){r&&r.d(f),f&&N(t),s&&s.d(f),f&&N(n),u&&u.d(f),f&&N(l),a&&a.d(f),f&&N(o)}}}function nd(e){let t;return{c(){t=A("h4"),t.textContent="Download Data",h(t,"slot","header"),h(t,"class","svelte-sy2m0x")},m(n,l){T(n,t,l)},p:U,d(n){n&&N(t)}}}function ld(e){let t,n,l,o;function r(a){e[13](a)}function s(a){e[14](a)}let u={handleClose:e[7],$$slots:{header:[nd],default:[td]},$$scope:{ctx:e}};return e[0]!==void 0&&(u.showModal=e[0]),e[1]!==void 0&&(u.dialog=e[1]),t=new ed({props:u}),et.push(()=>Rn(t,"showModal",r)),et.push(()=>Rn(t,"dialog",s)),{c(){ne(t.$$.fragment)},m(a,f){ee(t,a,f),o=!0},p(a,[f]){const c={};f&32780&&(c.$$scope={dirty:f,ctx:a}),!n&&f&1&&(n=!0,c.showModal=a[0],An(()=>n=!1)),!l&&f&2&&(l=!0,c.dialog=a[1],An(()=>l=!1)),t.$set(c)},i(a){o||(V(t.$$.fragment,a),o=!0)},o(a){z(t.$$.fragment,a),o=!1},d(a){te(t,a)}}}function od(e,t,n){let{showModal:l,table:o}=t,r,s="";const u={FILE_INPUT:0,DOWNLOADED:1,FAILED_DOWNLOAD:2,OVERWRITE:3};let a=u.FILE_INPUT;const f=async w=>{const S={file_name:w},$=await(await fetch(`/chat/${o}/save_to_csv`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)})).json();console.log("Download Complete: ",$),$.status==="200"?(console.log("success"),n(3,a=u.DOWNLOADED)):(console.log("failed"),n(3,a=u.FAILED_DOWNLOAD))},c=async w=>{w.preventDefault();const S=await fetch(`/file_exists/?file_name=${s}.csv`),{file_exists:M}=await S.json();M===!0?n(3,a=u.OVERWRITE):f(s)};function d(){n(0,l=!1),n(3,a=u.FILE_INPUT),r.close()}function p(){s=this.value,n(2,s)}const g=()=>n(3,a=u.FILE_INPUT),m=()=>n(3,a=u.FILE_INPUT),_=()=>f(s);function v(w){l=w,n(0,l)}function y(w){r=w,n(1,r)}return e.$$set=w=>{"showModal"in w&&n(0,l=w.showModal),"table"in w&&n(8,o=w.table)},[l,r,s,a,u,f,c,d,o,p,g,m,_,v,y]}class Io extends ce{constructor(t){super(),de(this,t,od,ld,fe,{showModal:0,table:8})}}function ri(e,t,n){const l=e.slice();return l[19]=t[n],l[21]=n,l}function si(e){let t,n,l,o,r,s;function u(...f){return e[12](e[21],...f)}function a(...f){return e[13](e[21],...f)}return{c(){t=A("div"),n=A("button"),n.textContent="👍",l=P(),o=A("button"),o.textContent="👎",h(n,"class","small-button thumbs-up svelte-19cad35"),h(o,"class","small-button thumbs-down svelte-19cad35"),h(t,"class","feedback-buttons svelte-19cad35")},m(f,c){T(f,t,c),b(t,n),b(t,l),b(t,o),r||(s=[x(n,"click",u),x(o,"click",a)],r=!0)},p(f,c){e=f},d(f){f&&N(t),r=!1,ve(s)}}}function ai(e,t){let n,l,o,r,s,u,a,f,c,d=t[19].question+"",p,g,m,_,v,y,w,S=t[19].answer+"",M,$,F,C,R,k,E=t[0]&&si(t);return{key:e,first:null,c(){n=A("div"),l=A("div"),o=A("div"),r=P(),s=A("div"),u=A("div"),a=A("h5"),a.textContent="Question:",f=P(),c=A("p"),p=q(d),g=P(),m=A("div"),_=A("div"),v=A("h5"),v.textContent="Response:",y=P(),w=A("p"),M=q(S),$=P(),E&&E.c(),F=P(),h(o,"class","avatar"),h(a,"class","bold svelte-19cad35"),h(u,"class","question svelte-19cad35"),h(v,"class","bold svelte-19cad35"),h(_,"class","answer svelte-19cad35"),h(m,"class","answers svelte-19cad35"),h(s,"class","message-content svelte-19cad35"),h(l,"class","chat-message-center svelte-19cad35"),h(n,"class","chat-message svelte-19cad35"),this.first=n},m(I,D){T(I,n,D),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,p),b(s,g),b(s,m),b(m,_),b(_,v),b(_,y),b(_,w),b(w,M),b(_,$),E&&E.m(_,null),b(n,F),R||(k=en(C=rd.call(null,n,t[21]===t[5].length-1)),R=!0)},p(I,D){t=I,D&32&&d!==(d=t[19].question+"")&&K(p,d),D&32&&S!==(S=t[19].answer+"")&&K(M,S),t[0]?E?E.p(t,D):(E=si(t),E.c(),E.m(_,null)):E&&(E.d(1),E=null),C&&Ve(C.update)&&D&32&&C.update.call(null,t[21]===t[5].length-1)},d(I){I&&N(n),E&&E.d(),R=!1,k()}}}function id(e){let t,n,l,o,r,s,u,a,f,c,d,p,g,m,_=[],v=new Map,y,w,S,M,$,F,C=(e[3]?e[4]:"Send")+"",R,k,E,I,D,L,O;function B(W){e[11](W)}let j={table:"qa_table"};e[1]!==void 0&&(j.showModal=e[1]),t=new Io({props:j}),et.push(()=>Rn(t,"showModal",B));let ae=e[5];const pe=W=>W[21];for(let W=0;W👍
button. If the repsonse is not satisfactory, click on the
- 👎 button.`,f=N(),c=A("button"),c.textContent="Download Data",d=N(),g=A("div"),p=A("section"),m=A("div");for(let W=0;W<_.length;W+=1)_[W].c();y=N(),w=A("div"),S=A("form"),M=A("input"),$=N(),F=A("button"),R=q(C),E=N(),I=A("p"),I.textContent="Note - may produce inaccurate information.",h(s,"class","underline bold svelte-19cad35"),h(a,"class","svelte-19cad35"),h(c,"class","svelte-19cad35"),h(r,"class","instructions svelte-19cad35"),h(m,"class","chat-log svelte-19cad35"),h(p,"class","chatbox svelte-19cad35"),h(M,"class","chat-input-textarea svelte-19cad35"),h(M,"placeholder","Type Question Here"),h(F,"class",k="btnyousend "+(e[2]===""?"":"active")+" svelte-19cad35"),h(F,"type","submit"),h(S,"class","chat-input-form svelte-19cad35"),h(I,"class","message svelte-19cad35"),h(w,"class","chat-input-holder svelte-19cad35"),h(g,"class","ranked-chat svelte-19cad35"),h(o,"class","ranked-feedback-container svelte-19cad35")},m(W,Q){ee(t,W,Q),T(W,l,Q),T(W,o,Q),b(o,r),b(r,s),b(r,u),b(r,a),b(r,f),b(r,c),b(o,d),b(o,g),b(g,p),b(p,m);for(let X=0;X<_.length;X+=1)_[X]&&_[X].m(m,null);b(g,y),b(g,w),b(w,S),b(S,M),Ye(M,e[2]),b(S,$),b(S,F),b(F,R),b(w,E),b(w,I),D=!0,L||(O=[x(c,"click",e[8]),x(M,"input",e[14]),x(S,"submit",e[6])],L=!0)},p(W,[Q]){const X={};!n&&Q&2&&(n=!0,X.showModal=W[1],$n(()=>n=!1)),t.$set(X),Q&161&&(ae=W[5],_=gt(_,Q,pe,1,W,ae,v,m,zt,ai,null,ri)),Q&4&&M.value!==W[2]&&Ye(M,W[2]),(!D||Q&24)&&C!==(C=(W[3]?W[4]:"Send")+"")&&K(R,C),(!D||Q&4&&k!==(k="btnyousend "+(W[2]===""?"":"active")+" svelte-19cad35"))&&h(F,"class",k)},i(W){D||(V(t.$$.fragment,W),D=!0)},o(W){z(t.$$.fragment,W),D=!1},d(W){te(t,W),W&&P(l),W&&P(o);for(let Q=0;Q<_.length;Q+=1)_[Q].d();L=!1,be(O)}}}function od(e){setTimeout(()=>{e.scrollIntoView({behavior:"smooth"})},0)}async function id(e){const t=await fetch("/chat/qa_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function rd(e,t,n){let l,o;ue(e,qe,M=>n(5,o=M));let r=!1,{feedback:s=!1}=t,{is_retrieval:u=!1}=t,a="",f="",c=!1;ft(()=>{d()});async function d(){const C=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(R=>({id:R[0],question:R[1],answer:R[2],vote_status:R[3]}));Pe(qe,o=[...C],o)}const g=async M=>{M.preventDefault(),a=f,n(2,f=""),n(3,c=!0);let $={id:o.length+1,question:a,answer:"Loading...",vote_status:"na"};Pe(qe,o=[...o,$],o);const F=u?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})}):await fetch(`/chat/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})});if(F.ok){const C=await F.json();console.log("response data",C),$.answer=C.answer,qe.update(R=>(R[R.length-1]=$,R))}else{const C=await F.text();alert(C)}n(3,c=!1)};let p=0;setInterval(()=>{n(10,p=(p+1)%4)},200);function m(M,$,F){const C=o[F];C.vote=$;const R={id:F+1,vote_status:$};id(R),pt(M.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),pt(M.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}function _(){n(1,r=!0)}[...Array(10).keys()].map(M=>String.fromCharCode(65+M));function v(M){r=M,n(1,r)}const y=(M,$)=>m($,"up",M),w=(M,$)=>m($,"down",M);function S(){f=this.value,n(2,f)}return e.$$set=M=>{"feedback"in M&&n(0,s=M.feedback),"is_retrieval"in M&&n(9,u=M.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(4,l=".".repeat(p).padEnd(3))},[s,r,f,c,l,o,g,m,_,u,p,v,y,w,S]}class No extends ce{constructor(t){super(),de(this,t,rd,ld,fe,{feedback:0,is_retrieval:9})}}function ui(e,t,n){const l=e.slice();return l[14]=t[n],l[16]=n,l}function fi(e,t){let n,l,o,r,s,u,a,f,c,d=t[14].question+"",g,p,m,_,v,y,w,S=t[14].up_ranking_answer+"",M,$,F,C,R,k,E=t[14].low_ranking_answer+"",I,D,L,O,B;function j(...Q){return t[7](t[14],t[16],...Q)}function ae(...Q){return t[8](t[14],t[16],...Q)}function pe(...Q){return t[9](t[14],t[16],...Q)}function W(...Q){return t[10](t[14],t[16],...Q)}return{key:e,first:null,c(){n=A("div"),l=A("div"),o=A("div"),r=N(),s=A("div"),u=A("div"),a=A("h5"),a.textContent="Question:",f=N(),c=A("p"),g=q(d),p=N(),m=A("div"),_=A("div"),v=A("h5"),v.textContent="Response 1:",y=N(),w=A("p"),M=q(S),$=N(),F=A("div"),C=A("h5"),C.textContent="Response 2:",R=N(),k=A("p"),I=q(E),D=N(),h(o,"class","avatar"),h(a,"class","bold svelte-au920n"),h(u,"class","question svelte-au920n"),h(v,"class","bold underline svelte-au920n"),h(_,"class","answer svelte-au920n"),h(C,"class","bold underline svelte-au920n"),h(F,"class","answer svelte-au920n"),h(m,"class","answers svelte-au920n"),h(s,"class","message-content svelte-au920n"),h(l,"class","chat-message-center svelte-au920n"),h(n,"class","chat-message svelte-au920n"),this.first=n},m(Q,X){T(Q,n,X),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,g),b(s,p),b(s,m),b(m,_),b(_,v),b(_,y),b(_,w),b(w,M),b(m,$),b(m,F),b(F,C),b(F,R),b(F,k),b(k,I),b(n,D),O||(B=[x(_,"click",j),x(_,"keydown",ae),x(F,"click",pe),x(F,"keydown",W),Cn(L=ad.call(null,n,t[16]===t[3].length-1))],O=!0)},p(Q,X){t=Q,X&8&&d!==(d=t[14].question+"")&&K(g,d),X&8&&S!==(S=t[14].up_ranking_answer+"")&&K(M,S),X&8&&E!==(E=t[14].low_ranking_answer+"")&&K(I,E),L&&Ge(L.update)&&X&8&&L.update.call(null,t[16]===t[3].length-1)},d(Q){Q&&P(n),O=!1,be(B)}}}function sd(e){let t,n,l,o,r,s,u=[],a=new Map,f,c,d,g,p,m,_=(e[1]?e[2]:"Send")+"",v,y,w,S,M,$,F=e[3];const C=R=>R[16];for(let R=0;RRanked Feedback Instructions
+ 👎 button.`,f=P(),c=A("button"),c.textContent="Download Data",d=P(),p=A("div"),g=A("section"),m=A("div");for(let W=0;W<_.length;W+=1)_[W].c();y=P(),w=A("div"),S=A("form"),M=A("input"),$=P(),F=A("button"),R=q(C),E=P(),I=A("p"),I.textContent="Note - may produce inaccurate information.",h(s,"class","underline bold svelte-19cad35"),h(a,"class","svelte-19cad35"),h(c,"class","svelte-19cad35"),h(r,"class","instructions svelte-19cad35"),h(m,"class","chat-log svelte-19cad35"),h(g,"class","chatbox svelte-19cad35"),h(M,"class","chat-input-textarea svelte-19cad35"),h(M,"placeholder","Type Question Here"),h(F,"class",k="btnyousend "+(e[2]===""?"":"active")+" svelte-19cad35"),h(F,"type","submit"),h(S,"class","chat-input-form svelte-19cad35"),h(I,"class","message svelte-19cad35"),h(w,"class","chat-input-holder svelte-19cad35"),h(p,"class","ranked-chat svelte-19cad35"),h(o,"class","ranked-feedback-container svelte-19cad35")},m(W,Q){ee(t,W,Q),T(W,l,Q),T(W,o,Q),b(o,r),b(r,s),b(r,u),b(r,a),b(r,f),b(r,c),b(o,d),b(o,p),b(p,g),b(g,m);for(let X=0;X<_.length;X+=1)_[X]&&_[X].m(m,null);b(p,y),b(p,w),b(w,S),b(S,M),Ye(M,e[2]),b(S,$),b(S,F),b(F,R),b(w,E),b(w,I),D=!0,L||(O=[x(c,"click",e[8]),x(M,"input",e[14]),x(S,"submit",e[6])],L=!0)},p(W,[Q]){const X={};!n&&Q&2&&(n=!0,X.showModal=W[1],An(()=>n=!1)),t.$set(X),Q&161&&(ae=W[5],_=gt(_,Q,pe,1,W,ae,v,m,Lt,ai,null,ri)),Q&4&&M.value!==W[2]&&Ye(M,W[2]),(!D||Q&24)&&C!==(C=(W[3]?W[4]:"Send")+"")&&K(R,C),(!D||Q&4&&k!==(k="btnyousend "+(W[2]===""?"":"active")+" svelte-19cad35"))&&h(F,"class",k)},i(W){D||(V(t.$$.fragment,W),D=!0)},o(W){z(t.$$.fragment,W),D=!1},d(W){te(t,W),W&&N(l),W&&N(o);for(let Q=0;Q<_.length;Q+=1)_[Q].d();L=!1,ve(O)}}}function rd(e){setTimeout(()=>{e.scrollIntoView({behavior:"smooth"})},0)}async function sd(e){const t=await fetch("/chat/qa_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function ad(e,t,n){let l,o;ue(e,He,M=>n(5,o=M));let r=!1,{feedback:s=!1}=t,{is_retrieval:u=!1}=t,a="",f="",c=!1;ft(()=>{d()});async function d(){const C=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(R=>({id:R[0],question:R[1],answer:R[2],vote_status:R[3]}));De(He,o=[...C],o)}const p=async M=>{M.preventDefault(),a=f,n(2,f=""),n(3,c=!0);let $={id:o.length+1,question:a,answer:"Loading...",vote_status:"na"};De(He,o=[...o,$],o);const F=u?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})}):await fetch(`/chat/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})});if(F.ok){const C=await F.json();console.log("response data",C),$.answer=C.answer,He.update(R=>(R[R.length-1]=$,R))}else{const C=await F.text();alert(C)}n(3,c=!1)};let g=0;setInterval(()=>{n(10,g=(g+1)%4)},200);function m(M,$,F){const C=o[F];C.vote=$;const R={id:F+1,vote_status:$};sd(R),pt(M.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),pt(M.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}function _(){n(1,r=!0)}[...Array(10).keys()].map(M=>String.fromCharCode(65+M));function v(M){r=M,n(1,r)}const y=(M,$)=>m($,"up",M),w=(M,$)=>m($,"down",M);function S(){f=this.value,n(2,f)}return e.$$set=M=>{"feedback"in M&&n(0,s=M.feedback),"is_retrieval"in M&&n(9,u=M.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(4,l=".".repeat(g).padEnd(3))},[s,r,f,c,l,o,p,m,_,u,g,v,y,w,S]}class No extends ce{constructor(t){super(),de(this,t,ad,id,fe,{feedback:0,is_retrieval:9})}}function ui(e,t,n){const l=e.slice();return l[14]=t[n],l[16]=n,l}function fi(e,t){let n,l,o,r,s,u,a,f,c,d=t[14].question+"",p,g,m,_,v,y,w,S=t[14].up_ranking_answer+"",M,$,F,C,R,k,E=t[14].low_ranking_answer+"",I,D,L,O,B;function j(...Q){return t[7](t[14],t[16],...Q)}function ae(...Q){return t[8](t[14],t[16],...Q)}function pe(...Q){return t[9](t[14],t[16],...Q)}function W(...Q){return t[10](t[14],t[16],...Q)}return{key:e,first:null,c(){n=A("div"),l=A("div"),o=A("div"),r=P(),s=A("div"),u=A("div"),a=A("h5"),a.textContent="Question:",f=P(),c=A("p"),p=q(d),g=P(),m=A("div"),_=A("div"),v=A("h5"),v.textContent="Response 1:",y=P(),w=A("p"),M=q(S),$=P(),F=A("div"),C=A("h5"),C.textContent="Response 2:",R=P(),k=A("p"),I=q(E),D=P(),h(o,"class","avatar"),h(a,"class","bold svelte-au920n"),h(u,"class","question svelte-au920n"),h(v,"class","bold underline svelte-au920n"),h(_,"class","answer svelte-au920n"),h(C,"class","bold underline svelte-au920n"),h(F,"class","answer svelte-au920n"),h(m,"class","answers svelte-au920n"),h(s,"class","message-content svelte-au920n"),h(l,"class","chat-message-center svelte-au920n"),h(n,"class","chat-message svelte-au920n"),this.first=n},m(Q,X){T(Q,n,X),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,p),b(s,g),b(s,m),b(m,_),b(_,v),b(_,y),b(_,w),b(w,M),b(m,$),b(m,F),b(F,C),b(F,R),b(F,k),b(k,I),b(n,D),O||(B=[x(_,"click",j),x(_,"keydown",ae),x(F,"click",pe),x(F,"keydown",W),en(L=fd.call(null,n,t[16]===t[3].length-1))],O=!0)},p(Q,X){t=Q,X&8&&d!==(d=t[14].question+"")&&K(p,d),X&8&&S!==(S=t[14].up_ranking_answer+"")&&K(M,S),X&8&&E!==(E=t[14].low_ranking_answer+"")&&K(I,E),L&&Ve(L.update)&&X&8&&L.update.call(null,t[16]===t[3].length-1)},d(Q){Q&&N(n),O=!1,ve(B)}}}function ud(e){let t,n,l,o,r,s,u=[],a=new Map,f,c,d,p,g,m,_=(e[1]?e[2]:"Send")+"",v,y,w,S,M,$,F=e[3];const C=R=>R[16];for(let R=0;RRanked Feedback Instructions
Ask a question and click on the better of the two responses. The better
response will be outlined in green, the worse
response outlined in red. This data will be
automatically fed to RLHF.