Skip to content

Conversation

JunJie-Lai
Copy link

@JunJie-Lai JunJie-Lai commented Jun 21, 2025

Description

Added Text Rewriter Tool. Rephrase, summarize or simplify any text with user instructions.

Related Issue

#128 - Epic 2.10 Text Rewriter

Type of Change

  • New feature: A non-breaking change that adds functionality.

Proposed Solution

Describe your code changes in detail. Explain how you implemented your solution and any design decisions you made.

  • Allow user input text and/or file upload in supported formats.
    • Upload: CSV, PDF, DOCX, PPT, Plain Text
    • URLs: YouTube Video, Website, Google Sheets
  • Allow user input rewrite instruction and generate rewritten text tailored to the instructions.
  • The rewritten text is aligned with the specified instruction and maintains original context and tone.
  • The rewritten text is presented in a clear, editable format.

How to Test

Send POST Request to /submit-tool with the following JSON: 

{
  "user": {
    "id": "string",
    "fullName": "string",
    "email": "string"
  },
  "type": "tool",
  "tool_data": {
    "tool_id": "text-rewriter",
    "inputs": [
      {
        "name": "text_input",
        "value": "Romeo and Juliet is a tragic play by William Shakespeare that tells the story of two young lovers whose deaths ultimately reconcile their feuding families."
      },
      {
        "name": "rewrite_instruction",
        "value": "Simplify the text for a middle school audience."
      },
      {
        "name": "file_url",
        "value": ""
      },
      {
        "name": "file_type",
        "value": ""
      },
      {
        "name": "lang",
        "value": "en"
      }
    ]
  }
}

Expected Outcomes

{
  "data": {
    "rewritten_text": "Romeo and Juliet is a Shakespeare play about two kids who fall in love, but their families hate each other. Sadly, the story ends with both of them dying, which finally gets their families to stop fighting."
  }
}

Unit Tests

  • Write unit tests for all functions and classes in core.py and tools.py using PyTest.
    • Tests cover:
      • Normal operation with valid inputs.
      • Edge cases and invalid inputs.
      • Error handling and exceptions.

Documentation Updates

Indicate whether documentation needs to be updated due to this PR.

  • No

If yes, describe what documentation updates are needed and link to the relevant documentation.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Additional Information

None

@JunJie-Lai JunJie-Lai changed the title Text Rewriter Tool Epic 2.11 Text Rewriter Tool Jul 23, 2025
@JunJie-Lai JunJie-Lai changed the title Epic 2.11 Text Rewriter Tool Epic 2.10 Text Rewriter Tool Jul 23, 2025
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.

1 participant