Spaces:
Running
Running
Create readme.md based on app.py
Browse filesThis commit creates a readme.md file based on the contents of app.py, describing the application, its usage, and architecture.
readme.md
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SmolSWE Gradio Interface
|
2 |
+
|
3 |
+
This application provides a Gradio interface for interacting with the SmolSWE AI agent, designed for software development tasks. It allows users to provide prompts and upload files to assist the agent in performing tasks such as refactoring, debugging, adding features, and more.
|
4 |
+
|
5 |
+
## Usage
|
6 |
+
|
7 |
+
1. **Enter Hugging Face Space ID:** In the sidebar, enter the Hugging Face Space ID for your project (e.g., `username/space-name`). This will initialize the agent and connect it to your project repository.
|
8 |
+
2. **Initialization Status:** Check the "Initialization Status" textbox to confirm that the agent has been successfully initialized.
|
9 |
+
3. **Input Prompt:** In the "Your request" section, enter your prompt in the "Chat Message" textbox. This prompt should describe the task you want the agent to perform (e.g., "Refactor the `app.py` file to improve readability").
|
10 |
+
4. **Upload Files (Optional):** You can upload files to provide additional context or data to the agent. The agent supports `.pdf`, `.docx`, and `.txt` file types. To upload a file, click the "Upload File" button. The file path will be provided to the agent in a text format.
|
11 |
+
5. **Submit Request:** Press Shift+Enter or click the "Submit" button to send your prompt to the agent.
|
12 |
+
6. **View Agent Responses:** The agent's responses will be displayed in the main chat interface. The responses may include code snippets, execution logs, and final answers.
|
13 |
+
|
14 |
+
## Architecture
|
15 |
+
|
16 |
+
The application utilizes the following underlying architecture:
|
17 |
+
|
18 |
+
* **Planning Agent:** A high-level planning agent responsible for breaking down complex user requests into actionable steps and delegating coding tasks to the Software Engineering Agent. It focuses on strategy, task decomposition, and coordinating the overall development process.
|
19 |
+
* **Software Engineering Agent:** An expert Software Engineer capable of designing, developing, and debugging code. This agent can read and write files, search the web, and scrape web content to assist in coding tasks. It excels at implementing detailed technical specifications provided by the Planning Agent.
|
20 |
+
|
21 |
+
The agents use the `LiteLLMModel` with the `gemini/gemini-2.0-flash` model. They also leverage a suite of tools for interacting with the file system, searching the web, and scraping web content:
|
22 |
+
|
23 |
+
* `search`: Searches the web for information.
|
24 |
+
* `scraper`: Scrapes content from web pages.
|
25 |
+
* `FileReader`: Reads files from the file system.
|
26 |
+
* `FileWriter`: Writes files to the file system.
|
27 |
+
* `FileCopier`: Copies files.
|
28 |
+
* `FileMover`: Moves files.
|
29 |
+
* `FileDeleter`: Deletes files.
|
30 |
+
* `FileSearcher`: Searches for text within files.
|
31 |
+
* `CommitChanges`: Commits changes to the repository.
|
32 |
+
|
33 |
+
## Notes
|
34 |
+
* The agent will create a temporary directory based on the space_id, and use it for the file operations. When the space_id is changed, the old temporary directory will be deleted.
|
35 |
+
* After the agent is initialized, if the space_id input is cleared, the agent will be uninitialized.
|
36 |
+
|
37 |
+
## Powered By
|
38 |
+
|
39 |
+
[smolagents](https://github.com/huggingface/smolagents)
|