Skip to content

Commit

Permalink
add Download Data button and DownloadModal to Chatbot and RAGChatbot
Browse files Browse the repository at this point in the history
  • Loading branch information
jojortz committed Sep 27, 2023
1 parent 588b44a commit 0bf1e8a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 36 deletions.
13 changes: 10 additions & 3 deletions pykoi/frontend/src/lib/Chatbots/Chatbot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import { chatLog } from "../../store";
import { onMount } from "svelte";
import { select } from "d3-selection";
import { slide } from "svelte/transition";
import { writable } from "svelte/store";
import { tooltip } from "../../utils.js";
import DownloadModal from "./Components/DownloadModal.svelte";
let showModal = false;
export let feedback = false;
export let is_retrieval = false;
Expand Down Expand Up @@ -132,11 +133,17 @@
.style("opacity", 1);
}
function handleDownloadClick () {
showModal = true;
}
let chatLetters = [...Array(10).keys()].map((i) =>
String.fromCharCode(65 + i)
);
</script>

<DownloadModal bind:showModal table="qa_table"/>

<div class="ranked-feedback-container">
<div class="instructions">
<h5 class="underline bold">Vote Feedback Instructions</h5>
Expand All @@ -146,7 +153,7 @@
button. If the repsonse is not satisfactory, click on the
<span class="inline-button red">👎</span> button.
</p>
<!-- <button>Download Data</button> -->
<button on:click={handleDownloadClick}>Download Data</button>
</div>
<div class="ranked-chat">
<section class="chatbox">
Expand Down
42 changes: 9 additions & 33 deletions pykoi/frontend/src/lib/Chatbots/RAGChatbot.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script>
import { chatLog, checkedDocs } from "../../store";
import { onMount } from "svelte";
import { select } from "d3-selection";
import { writable } from "svelte/store";
import Dropdown from "./Components/Dropdown.svelte";
import { tooltip } from "../../utils.js";
import SourceContainer from "./Components/SourceContainer.svelte";
import Tabs from "../UIComponents/Tabs.svelte";
import ModifiedAnswer from "./Components/ModifiedAnswer.svelte";
import Answer from "./Components/Answer.svelte";
import DownloadModal from "./Components/DownloadModal.svelte";
export let feedback = false;
export let is_retrieval = false;
Expand All @@ -18,7 +18,7 @@
let mymessage = "";
let messageplaceholder = "";
let chatLoading = false;
let editting_response = true;
let showModal = false;
let items = [
{
Expand Down Expand Up @@ -146,8 +146,14 @@
const ragSourcesString = ragSources.join(", ");
return ragSourcesString;
}
function handleDownloadClick() {
showModal = true;
}
</script>

<DownloadModal bind:showModal table="rag_table" />

<div class="ranked-feedback-container">
<div class="instructions">
<h5 class="underline bold">Vote Feedback Instructions</h5>
Expand All @@ -157,7 +163,7 @@
button. If the response is not satisfactory, click on the
<span class="inline-button red">👎</span> button.
</p>
<!-- <button>Download Data</button> -->
<button on:click={handleDownloadClick}>Download Data</button>
</div>
<div class="ranked-chat">
<section class="chatbox">
Expand Down Expand Up @@ -224,37 +230,7 @@
grid-template-columns: 20% 80%;
width: 100%;
}
/* .small-button {
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 {
text-align: center;
margin: auto;
width: 20%;
}
.small-button:hover {
box-shadow: var(--shadow-md);
}
.thumbs-up,
.thumbs-up:hover,
.thumbs-up::selection {
background: var(--green);
}
.thumbs-down,
.thumbs-down:hover,
.thumbs-down::selection {
background: var(--red);
} */
.ranked-chat {
height: 100vh;
display: grid;
Expand Down

0 comments on commit 0bf1e8a

Please sign in to comment.