Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +21 -22
src/streamlit_app.py
CHANGED
|
@@ -131,60 +131,59 @@ TOOL_PRESETS = {
|
|
| 131 |
"icon": "🎨",
|
| 132 |
"title": "Code Generator",
|
| 133 |
"color": "#00ff88",
|
| 134 |
-
"system_prompt": "
|
| 135 |
"templates": {
|
| 136 |
-
"Flask REST API": "
|
| 137 |
-
"React Component": "
|
| 138 |
-
"Python CLI Tool": "
|
| 139 |
-
"FastAPI Endpoint": "
|
| 140 |
}
|
| 141 |
},
|
| 142 |
"refactor": {
|
| 143 |
"icon": "🔄",
|
| 144 |
"title": "Code Refactorer",
|
| 145 |
"color": "#00aaff",
|
| 146 |
-
"system_prompt": "
|
| 147 |
"templates": {
|
| 148 |
-
"Clean Code": "
|
| 149 |
-
"Performance": "
|
| 150 |
-
"Type Safety": "
|
| 151 |
}
|
| 152 |
},
|
| 153 |
"debug": {
|
| 154 |
"icon": "🐛",
|
| 155 |
"title": "Debug Helper",
|
| 156 |
"color": "#ff4444",
|
| 157 |
-
"system_prompt": "
|
| 158 |
"templates": {
|
| 159 |
-
"Error Analysis": "
|
| 160 |
-
"Logic Bug": "
|
| 161 |
-
"Performance Issue": "
|
| 162 |
}
|
| 163 |
},
|
| 164 |
"docs": {
|
| 165 |
"icon": "📚",
|
| 166 |
"title": "Doc Generator",
|
| 167 |
"color": "#ffaa00",
|
| 168 |
-
"system_prompt": "
|
| 169 |
"templates": {
|
| 170 |
-
"Function Docs": "
|
| 171 |
-
"README": "
|
| 172 |
-
"API Docs": "
|
| 173 |
}
|
| 174 |
},
|
| 175 |
"explain": {
|
| 176 |
"icon": "💡",
|
| 177 |
"title": "Code Explainer",
|
| 178 |
"color": "#aa88ff",
|
| 179 |
-
"system_prompt": "
|
| 180 |
"templates": {
|
| 181 |
-
"ELI5": "
|
| 182 |
-
"Deep Dive": "
|
| 183 |
-
"Architecture": "
|
| 184 |
}
|
| 185 |
}
|
| 186 |
}
|
| 187 |
-
|
| 188 |
# ----------------------------------------------------
|
| 189 |
# SIDEBAR
|
| 190 |
# ----------------------------------------------------
|
|
|
|
| 131 |
"icon": "🎨",
|
| 132 |
"title": "Code Generator",
|
| 133 |
"color": "#00ff88",
|
| 134 |
+
"system_prompt": "You are an Expert Code Generator. Create clean, production-ready code with comments. Respond ONLY with code in Markdown code blocks.",
|
| 135 |
"templates": {
|
| 136 |
+
"Flask REST API": "Create a Flask REST API with:\n- CRUD Endpoints for 'tasks'\n- SQLAlchemy Models\n- Error Handling\n- CORS enabled",
|
| 137 |
+
"React Component": "Create a React Functional Component with:\n- Props for title and items (Array)\n- useState for selected item\n- Tailwind CSS Styling\n- Click Handler",
|
| 138 |
+
"Python CLI Tool": "Create a Python CLI Tool with:\n- argparse for Arguments\n- Logging\n- Error Handling\n- Main Guard",
|
| 139 |
+
"FastAPI Endpoint": "Create FastAPI Endpoints:\n- POST /users - Create User\n- GET /users/{id} - Get User\n- Pydantic Models\n- SQLAlchemy Integration",
|
| 140 |
}
|
| 141 |
},
|
| 142 |
"refactor": {
|
| 143 |
"icon": "🔄",
|
| 144 |
"title": "Code Refactorer",
|
| 145 |
"color": "#00aaff",
|
| 146 |
+
"system_prompt": "You are a Code Refactoring Expert. Analyze code and improve: readability, performance, best practices. Explain your changes briefly.",
|
| 147 |
"templates": {
|
| 148 |
+
"Clean Code": "Refactor this code according to Clean Code principles:\n- Improve Naming\n- Reduce Complexity\n- Extract Functions\n\n[Insert Code Here]",
|
| 149 |
+
"Performance": "Optimize this code for performance:\n- Identify Bottlenecks\n- Improve Algorithms\n- Reduce Memory Usage\n\n[Insert Code Here]",
|
| 150 |
+
"Type Safety": "Add Type Hints/TypeScript:\n- All Functions\n- Variables where appropriate\n- Return Types\n\n[Insert Code Here]",
|
| 151 |
}
|
| 152 |
},
|
| 153 |
"debug": {
|
| 154 |
"icon": "🐛",
|
| 155 |
"title": "Debug Helper",
|
| 156 |
"color": "#ff4444",
|
| 157 |
+
"system_prompt": "You are a Debugging Expert. Analyze code/errors systematically. Explain the problem and provide the fix.",
|
| 158 |
"templates": {
|
| 159 |
+
"Error Analysis": "I have this error:\n[Error Message]\n\nIn this code:\n[Code]\n\nWhat is the problem and how do I fix it?",
|
| 160 |
+
"Logic Bug": "This code doesn't do what it's supposed to:\n[Code]\n\nExpected behavior: [describe]\nActual behavior: [describe]\n\nWhere is the logic bug?",
|
| 161 |
+
"Performance Issue": "This code is too slow:\n[Code]\n\nInput Size: [describe]\nCurrent Runtime: [describe]\n\nWhere is the problem?",
|
| 162 |
}
|
| 163 |
},
|
| 164 |
"docs": {
|
| 165 |
"icon": "📚",
|
| 166 |
"title": "Doc Generator",
|
| 167 |
"color": "#ffaa00",
|
| 168 |
+
"system_prompt": "You are a Technical Writer. Create clear, structured documentation with examples.",
|
| 169 |
"templates": {
|
| 170 |
+
"Function Docs": "Create Docstrings for these functions:\n[Code]\n\nFormat: Google Style for Python / JSDoc for JavaScript",
|
| 171 |
+
"README": "Create a README.md for this project:\n- Description\n- Installation\n- Usage Examples\n- API Reference\n\nProject: [describe]",
|
| 172 |
+
"API Docs": "Create API Documentation for these Endpoints:\n[Code/Routes]\n\nIncl. Request/Response Examples",
|
| 173 |
}
|
| 174 |
},
|
| 175 |
"explain": {
|
| 176 |
"icon": "💡",
|
| 177 |
"title": "Code Explainer",
|
| 178 |
"color": "#aa88ff",
|
| 179 |
+
"system_prompt": "You are a Code Educator. Explain code step-by-step, clearly and understandably.",
|
| 180 |
"templates": {
|
| 181 |
+
"ELI5": "Explain this code as if I were 5:\n[Code]",
|
| 182 |
+
"Deep Dive": "Explain this code in detail:\n- What does it do?\n- How does it work?\n- Why was it solved this way?\n- Alternatives?\n\n[Code]",
|
| 183 |
+
"Architecture": "Explain the architecture of this code:\n- Design Patterns\n- Components\n- Data Flow\n\n[Code]",
|
| 184 |
}
|
| 185 |
}
|
| 186 |
}
|
|
|
|
| 187 |
# ----------------------------------------------------
|
| 188 |
# SIDEBAR
|
| 189 |
# ----------------------------------------------------
|