Add utility for conversion of data into Markdown before passing to LLM/Agent
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Currently, raw data (JSON, text, or mixed formats) is directly passed to the LLM/Agent.
This can lead to inconsistent context interpretation, poor formatting in responses, and increased token cost.
We need to implement a preprocessing step that converts incoming data into Markdown format before it’s sent to the LLM or agent.
This ensures:
- Better readability and structured prompts for the model
- Consistent data representation across different sources
- Easier debugging and inspection
✅ Tasks / Acceptance Criteria:
- Add a 'convert_to_markdown(data)' utility function in `_api_helper.py` file.
- Support conversion from:
- - Raw Gmail body may contain mixed data format (URL, HTML, MD, etc) → Markdown format layout
- - JSON → formatted code block with syntax highlighting
- - Dictionaries / Lists → bullet or table format
- - Plain text → wrapped with Markdown-safe formatting
- Add unit tests to validate Markdown output consistency (Use AI 😏)
- Update related documentation or comments
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading _api_helper.py and tracing where raw Gmail, JSON, dictionary, list, or plain-text data is passed to the LLM or agent. Define the expected Markdown output for each stated input type, add unit tests for consistent output, and update related documentation or comments. Done means the preprocessing utility is used before the model receives the data and the tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, python
- Domain
- ai, backend, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100