Skip to content

FEAT: Extend data exporter to support Markdown (#1033)#1042

Merged
rlundeen2 merged 6 commits intomicrosoft:mainfrom
1twodrei:main
Aug 13, 2025
Merged

FEAT: Extend data exporter to support Markdown (#1033)#1042
rlundeen2 merged 6 commits intomicrosoft:mainfrom
1twodrei:main

Conversation

@1twodrei
Copy link
Copy Markdown
Contributor

@1twodrei 1twodrei commented Aug 1, 2025

Description

This pull request adds the capability to export conversation data to Markdown format (.md), resolving issue #1033. @romanlutz

The MemoryExporter class has been extended with a new export_to_markdown method and integrated into the main export_data function. This allows users to generate human-readable reports
of prompt request data directly into a Markdown table, in addition to the existing JSON and CSV formats.

Tests and Documentation

  • Tests:
    • Added a new test case to the parameterized test test_export_data_creates_file in tests/unit/memory/test_memory_exporter.py.
    • This new case specifically validates that calling export_data with export_type="md" successfully creates a non-empty output file, ensuring the new export path works as expected.
  • Documentation:
    • Added a docstring to the new export_to_markdown method in pyrit/memory/memory_exporter.py, explaining its purpose, arguments, and potential exceptions.

@1twodrei
Copy link
Copy Markdown
Contributor Author

1twodrei commented Aug 1, 2025

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

@rlundeen2 rlundeen2 left a comment

Choose a reason for hiding this comment

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

Running tests, but looks good to me if everything passes

Added a newline to `test_memory_exporter.py`. Does this resolve:

```
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/unit/memory/test_memory_exporter.py
@1twodrei
Copy link
Copy Markdown
Contributor Author

1twodrei commented Aug 5, 2025

@rlundeen2 Added a newline to test_memory_exporter.py. Does this resolve:

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/unit/memory/test_memory_exporter.py

@rlundeen2 rlundeen2 self-assigned this Aug 11, 2025
@jsong468
Copy link
Copy Markdown
Contributor

@rlundeen2 Added a newline to test_memory_exporter.py. Does this resolve:

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/unit/memory/test_memory_exporter.py

Hi! some of the pre-commit hooks are failing. See this to fix, and then we can merge it in!

@rlundeen2 rlundeen2 merged commit da79bc3 into microsoft:main Aug 13, 2025
20 checks 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