Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSV Download frontend and backend #70

Merged
merged 14 commits into from
Oct 3, 2023
Merged

Add CSV Download frontend and backend #70

merged 14 commits into from
Oct 3, 2023

Conversation

jojortz
Copy link
Contributor

@jojortz jojortz commented Sep 27, 2023

  • Updated save_to_csv function for both the rag_database and qa_database
  • Added endpoints for saving to CSV for RAG table and QA Table
  • Created Modal UI component and custom DownloadModal for CSV filename input on download
  • Added DownloadModal and Download button to Chatbot and RAGChatbot frontend compoenents

@goldmermaid
Copy link
Collaborator

Great work! I just tested the Download button, it can download all my data.

One more feature to improve the user experience: When I downloaded the file, I didn't know where it's saved at. Could you add the note in the download UI that "will be saved in the ~/pykoi/ folder"?

@CambioML
Copy link
Collaborator

Regarding the download feature, I am just curious how hard it is to have a pop up window and let user pick the download location? User might git clone pykoi at any arbitrary location, so download at ~/pykoi/ might not be a good idea.

@@ -6,24 +6,29 @@
You can follow [the installation guide](https://github.com/CambioML/pykoi/tree/install#option-1-rag-cpu)
to set up the environment.
- Run the demo:
1. Enter your OpenAI API key in the `api_key` below.
1. Enter your OpenAI API key a .env file in the `~/pykoi` directory with the name OPEN_API_KEY, e.g.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ~/pykoi directory might not exist depending on where user clone the repo. You can say pykoi root directory.

- Run the demo:
1. Enter your OpenAI API key in the `api_key` below.
2. On terminal and `~/pykoi` directory, run
1. Enter your OpenAI API key a .env file in the `~/pykoi` directory with the name OPEN_API_KEY, e.g.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same

class RetrievalNewMessage(BaseModel):
prompt: str
file_names: List[str]

class QATableToCSV(BaseModel):
file_name: str

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make sure you run black command to make sure 2 lines between each class to avoid pylint and flake8 linting warning.

# list separator
QA_LIST_SEPARATOR = "||"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: run black command or add an empty line.

@CambioML
Copy link
Collaborator

CambioML commented Oct 3, 2023

LGTM overall.

TODO for next pr

  • add saving path configuration
  • ask for whether to override or not if file already exist.

@CambioML CambioML merged commit f87f830 into main Oct 3, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants