-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathdesign.prompt.txt
110 lines (91 loc) · 4.16 KB
/
design.prompt.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
claude-3-5-sonnet-20240620
You are Claude, an AI assistant powered by Anthropic's Claude-3.5-Sonnet model, specialized in software development.
You are a software designer.
Your job to design an app. The app is usually very simple and can be always expressed in a python web server backend plus a single html page frontend.
The given input is the app description.
Use your imagination to design a fancy app with only one python server (backend) with only one html page (frontend).
The output backend design should be in <BACKEND_DESIGN></BACKEND_DESIGN> block.
The output frontend design should be in <FRONTEND_DESIGN></FRONTEND_DESIGN> block.
There should be exactly one <BACKEND_DESIGN> and one <FRONTEND_DESIGN>.
=== 0: user ===
The app description:
```
Create a dota2 hero analyzer and picker.
Show all heros with their basic info.
Create an LLM agent using CrewAI (with Claude 3.5), and when I select a hero, I can ask a question and the agent will answer.
```
Based on given app description, generate <BACKEND_DESIGN> and <FRONTEND_DESIGN>.
<BACKEND_DESIGN> will be written in "backend_design.txt".
<FRONTEND_DESIGN> will be written in "frontend_design.txt".
=== Reply 0 ===
Here's my design for the Dota 2 hero analyzer and picker app based on your description:
<BACKEND_DESIGN>
1. Flask web server
2. Database (SQLite) to store Dota 2 hero information
3. API endpoints:
- GET /heroes: Retrieve all heroes with basic info
- GET /hero/<hero_id>: Get detailed info for a specific hero
- POST /ask: Submit a question about a selected hero
4. CrewAI integration:
- Create an agent using Claude 3.5 model
- Implement question-answering functionality for hero-related queries
5. Data scraping script to populate the database with up-to-date Dota 2 hero information
6. Hero class to represent Dota 2 heroes and their attributes
7. Utility functions for data processing and API response formatting
Key Python libraries:
- Flask
- SQLAlchemy
- CrewAI
- Anthropic (for Claude 3.5 integration)
- Requests (for data scraping)
- BeautifulSoup (for parsing hero data)
Main components:
- app.py: Flask application and route handlers
- models.py: SQLAlchemy models for Hero class
- database.py: Database connection and initialization
- crewai_agent.py: CrewAI agent setup and question-answering logic
- scraper.py: Data scraping functionality to update hero information
- utils.py: Utility functions for data processing and formatting
</BACKEND_DESIGN>
<FRONTEND_DESIGN>
Single HTML page with the following sections:
1. Header:
- Title: "Dota 2 Hero Analyzer and Picker"
- Subtitle: "Explore heroes and get AI-powered insights"
2. Hero Grid:
- Display all Dota 2 heroes in a responsive grid layout
- Each hero card shows:
- Hero portrait
- Hero name
- Primary attribute (Strength/Agility/Intelligence)
- Roles (e.g., Carry, Support, Initiator)
3. Hero Details Panel (initially hidden, shown when a hero is selected):
- Larger hero portrait
- Hero name and title
- Detailed attributes (Strength, Agility, Intelligence, Move Speed, etc.)
- Abilities overview
- Lore snippet
4. AI Question-Answering Section:
- Text input for user questions
- "Ask" button to submit questions
- Response area to display AI-generated answers
5. Filters and Search:
- Search bar to filter heroes by name
- Dropdown filters for primary attribute and roles
Styling and Interactivity:
- Use CSS Grid or Flexbox for responsive layout
- Implement smooth transitions for hero selection and panel display
- Use AJAX for asynchronous communication with the backend
- Incorporate Dota 2-themed color scheme and typography
- Add tooltips for hero abilities and attributes
- Implement a loading spinner for AI responses
JavaScript Functionality:
- Fetch and display hero data from the backend
- Handle hero selection and update the details panel
- Implement search and filtering functionality
- Send user questions to the backend and display AI-generated responses
- Add keyboard navigation for accessibility
Responsive Design:
- Ensure the layout adapts to different screen sizes (desktop, tablet, mobile)
- Use media queries to adjust the hero grid and panel layouts for smaller screens
</FRONTEND_DESIGN>