-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[FEAT] Improved CSV chat exports #700
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
Conversation
server/utils/helpers/chat/convertTo.jsConsider adding a check to ensure that the 'type' parameter passed to the 'prepareWorkspaceChatsForExport' function is either 'jsonl' or 'csv'. This will prevent potential errors if an unsupported type is passed. if (!['jsonl', 'csv'].includes(type)) {
throw new Error(`Unsupported export type: ${type}`);
}Consider extracting the logic for escaping and formatting CSV fields into a separate function. This will improve the readability of the code and make it easier to maintain. function escapeAndFormatCSVField(field) {
return `"${field.replace(/"/g, '""').replace(/\n/g, " ")}"`;
} |
* add more fields to csv export to make more useful * refactor from review comments * fix escapeCsv function * catch export errors properly --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
Pull Request Type
Relevant Issues
resolves #697
What is in this change?
Describe the changes in this PR that are impactful to the repo.
Improve CSV chat exports to include more data
CSV exports now include the following columns:
idusernameworkspace_namepromptresponsesent_atAdditional Information
Add any other context about the Pull Request here that was not captured above.
Developer Validations
yarn lintfrom the root of the repo & committed changes