princeton-nlp / SWE-agent

[NeurIPS 2024] SWE-agent takes a GitHub issue and tries to automatically fix it, using GPT-4, or your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges.
https://swe-agent.com
MIT License
13.66k stars 1.38k forks source link

Implement Feature to Handle User Input Markup Text for Feature Requests in SWE #656

Closed SyedMuqtasidAli closed 4 months ago

SyedMuqtasidAli commented 4 months ago

Describe the feature

Currently, the SWE tool is designed to work exclusively with GitHub issues URLs for debugging purposes. I would like to enhance the SWE tool to accept user input in the form of markup text, treating it as a feature request rather than a debugging task. This new functionality should enable users to provide detailed feature requests directly through a markup text form.

Here is an example of the markup text format for a feature request:

TaskName: Implement Basic Math Addition Function KnowledgeGraph: Function: adds Numbers Numbers: consists of Integer values CodeBase: Type: Simple Function Language: Python DesignKeyTradeOffs:

Potential Solutions

Markup Text Parsing:

Implement a parser to process the markup text format, extracting relevant information such as task name, knowledge graph, code base, design key trade-offs, design pattern, files CRUD operations, design details, design constraints, implementation best practices, risk mitigation strategies, test strategy, and estimated lines of code. Ensure the parser validates the input to confirm adherence to the expected markup format. User Interface Enhancement:

Modify the existing user interface to include an input field for markup text. Provide guidance and templates to users on how to format their feature requests correctly. Feature Request Handling:

Extend the SWE tool's functionality to distinguish between debugging tasks (from GitHub issues URLs) and feature requests (from markup text input). Implement logic to process and store feature requests, allowing for tracking and prioritization within the SWE tool. Feedback Mechanism:

Develop a feedback system that provides users with confirmation and status updates regarding their submitted feature requests. Integrate notifications or alerts to keep users informed about the progress of their requests. By implementing these solutions, the SWE tool will be more versatile, enabling users to submit and manage feature requests efficiently through a structured markup text format. This enhancement will improve the overall user experience and streamline the process of requesting new features.

klieret commented 4 months ago

You can already specify a markdown or text file as input with --data_path, see the docs. So nothing is stopping you from directly ingesting the file that you describe. Currently no specific parsing of that file is being done in SWE-agent, but since it's being fed to the LM , it has to be formatted as a string in the end anyway, so you could simply preprocess that file in whatever way you want before passing it to SWE-agent.