feat: more export types: dataframe, csv, string

Open
#121 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start with the existing Chat.export() method and review the context in querychat issue 34. Trace how chat turns are currently collected and written to Markdown, then determine the intended interfaces for string, dataframe, CSV, and Excel output. Done means the requested export representations are available without requiring file-writing side effects.

Written by the indexing model from the issue text.

Description

A user posted in querychat about exporting the chat history from the shiny application (https://github.com/posit-dev/querychat/issues/34). I ended up putting together code from the Chat.export() method to get the turns and save the text to a markdown file when the user clicks a shiny download button.

If people are going to be building chat applications in Shiny, I totally see the need for a few more export options, mainly being able to save a csv/excel/tabular file. Something that can then be processed in a data analysis pipeline.

Something else that might be useful is if Chat.export() can be refactored so the contents of the file can be accessed separate from writing the file as a side-effect. For example, a separate method to give me the dataframe of the turns/conversation and export saves the dataframe to a file.

In the issue I posed an example where I hobbled together the code for the markdown export type, but if there was a method that already had the string, I would only need to call that method to pass it in as the contexts for a shiny download button.

Dominant language
Python
Stars
179
Forks
32
Avg merge
1d 3h
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/chatlas

All issues in posit-dev/chatlas

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.