θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content

Conversation

@shatfield4
Copy link
Collaborator

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

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:

    • id
    • username
    • workspace_name
    • prompt
    • response
    • sent_at

Additional Information

Add any other context about the Pull Request here that was not captured above.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@shatfield4 shatfield4 linked an issue Feb 9, 2024 that may be closed by this pull request
@review-agent-prime
Copy link

server/utils/helpers/chat/convertTo.js

Consider 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.
Create Issue
See the diff
Checkout the fix

    if (!['jsonl', 'csv'].includes(type)) {
      throw new Error(`Unsupported export type: ${type}`);
    }
git fetch origin && git checkout -b ReviewBot/The-c-ew9c8u4 origin/ReviewBot/The-c-ew9c8u4

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.
Create Issue
See the diff
Checkout the fix

    function escapeAndFormatCSVField(field) {
      return `"${field.replace(/"/g, '""').replace(/\n/g, " ")}"`;
    }
git fetch origin && git checkout -b ReviewBot/The-c-5sj0sy6 origin/ReviewBot/The-c-5sj0sy6

@Mintplex-Labs Mintplex-Labs deleted a comment from review-agent-prime bot Feb 9, 2024
@Mintplex-Labs Mintplex-Labs deleted a comment from review-agent-prime bot Feb 9, 2024
@timothycarambat timothycarambat merged commit 1b29882 into master Feb 13, 2024
@timothycarambat timothycarambat deleted the 697-feat-improved-csv-chat-exports branch February 13, 2024 18:13
cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
* 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>
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.

[FEAT]: Improved CSV Chat Exports

3 participants