QuivrHQ / quivr

Opiniated RAG for integrating GenAI in your apps 🧠 Focus on your product rather than the RAG. Easy integration in existing products with customisation! Any LLM: GPT4, Groq, Llama. Any Vectorstore: PGVector, Faiss. Any Files. Anyway you want.
https://core.quivr.com
Other
36.66k stars 3.58k forks source link

[Feature]: csv file uploaded in the knowledge base should not be downloadable (via sources) #3151

Open atulgrover opened 2 months ago

atulgrover commented 2 months ago

The Feature

the csv file had tabular information and should not be downloadable by default... there must be an option to tuen off the sources for csv files....

image

Motivation, pitch

where in the code can I do it myself?

Twitter / LinkedIn details

No response

linear[bot] commented 2 months ago

CORE-193 [Feature]: csv file uploaded in the knowledge base should not be downloadable (via sources)

dosubot[bot] commented 2 months ago

To ensure that CSV files uploaded in the knowledge base are not downloadable by default and provide an option to turn off the sources for CSV files, you can modify the getOptions function to conditionally disable the "Download" option for CSV files. Additionally, you can add a new option to turn off the sources for CSV files.

Here's how you can modify the code:

  1. Add a check to disable the "Download" option for CSV files.
  2. Add a new option to turn off the sources for CSV files.
const getOptions = (): Option[] => [
    {
      label: "Delete",
      onClick: () => void onDeleteKnowledge(knowledge),
      iconName: "delete",
      iconColor: "dangerous",
      disabled: brain?.role !== "Owner",
    },
    {
      label: "Download",
      onClick: () => void downloadFile(),
      iconName: "download",
      iconColor: "primary",
      disabled: brain?.role !== "Owner" || !isUploadedKnowledge(knowledge) || knowledge.extension === ".csv",
    },
    {
      label: "Turn Off Source",
      onClick: () => void turnOffSource(),
      iconName: "toggle_off",
      iconColor: "warning",
      disabled: brain?.role !== "Owner" || knowledge.extension !== ".csv",
    },
  ];

const turnOffSource = () => {
  // Implement the logic to turn off the source for CSV files
  console.log(`Turning off source for knowledge ID: ${knowledge.id}`);
  setOptionsOpened(false);
};

In this modification:

This change should be made in the KnowledgeItem.tsx file located at frontend/app/studio/[brainId]/BrainManagementTabs/components/KnowledgeTab/KnowledgeTable/KnowledgeItem/KnowledgeItem.tsx.

To continue talking to Dosu, mention @dosu.