|
51 | 51 | ] |
52 | 52 | ``` |
53 | 53 |
|
54 | | -## 接口类型 |
55 | | -如RESTful API或GraphQL或GRPC等 |
56 | | - |
57 | | -## 请求方式 |
58 | | -POST、GET、DELETE、PUT等,没有请忽略 |
59 | | - |
60 | | -## 调用路径或调用方法 |
61 | | -path or method |
62 | | -
|
63 | 54 | ## 请求体参数 |
64 | 55 | ```python |
65 | 56 | [ |
|
81 | 72 | ] |
82 | 73 | ``` |
83 | 74 | """) |
| 75 | +FRONTEND_BACKEND = _(""" |
| 76 | +## Original Requirements |
| 77 | +Develop one ... |
| 78 | +
|
| 79 | +Product Goals |
| 80 | +```python |
| 81 | +[ |
| 82 | + "Create a ...", |
| 83 | +] |
| 84 | +``` |
| 85 | + |
| 86 | +User Stories |
| 87 | +```python |
| 88 | +[ |
| 89 | + "As a user, ...", |
| 90 | +] |
| 91 | +``` |
| 92 | +
|
| 93 | +## Frontend Design |
| 94 | +UI/UX Design |
| 95 | +```python |
| 96 | +[ |
| 97 | + "Three-column layout ...", |
| 98 | +] |
| 99 | +``` |
| 100 | + |
| 101 | +Frontend Business logic |
| 102 | +```python |
| 103 | +[ |
| 104 | + "Request the back-end interface to pass parameters ...", |
| 105 | +] |
| 106 | + |
| 107 | +## Backend RESTful API |
| 108 | +请求体参数 |
| 109 | +```python |
| 110 | +[ |
| 111 | + "name, type", |
| 112 | +] |
| 113 | +``` |
| 114 | + |
| 115 | +响应体参数 |
| 116 | +```python |
| 117 | +[ |
| 118 | + "name, type", |
| 119 | +] |
| 120 | +``` |
| 121 | +
|
| 122 | +Backend Business logic |
| 123 | +```python |
| 124 | +[ |
| 125 | + "Accept request parameter: ...", |
| 126 | +] |
| 127 | +""") |
84 | 128 | DOC_GAME = _(""" |
85 | 129 | ## 游戏名称 |
86 | 130 | pingpang game... |
@@ -177,6 +221,8 @@ def clarifyRequirement(self, requirementID, userPrompt, globalContext, appArchit |
177 | 221 | PRDTemplate = DOC_BACKEND |
178 | 222 | elif service["service_type"] == "GAME": |
179 | 223 | PRDTemplate = DOC_GAME |
| 224 | + elif service["service_type"] == "FRONTEND_BACKEND": |
| 225 | + PRDTemplate = FRONTEND_BACKEND |
180 | 226 |
|
181 | 227 | # todo 这个参数暂时不要调整,过多的澄清会导致出现幻觉,并且程序在获取澄清列表的时候也需要调整 |
182 | 228 | maxCycle = 2 |
@@ -276,11 +322,9 @@ def organize(requirementID, firstPrompt, PRDTemplate, appArchitecture, service_l |
276 | 322 | """+appArchitecture+""" |
277 | 323 | ``` |
278 | 324 |
|
279 | | -Output carefully referenced "Format example" in format. |
280 | | -## Format example |
| 325 | +Output carefully referenced "Format example" in format in """+getCurrentLanguageName()+""". |
| 326 | +# Format example |
281 | 327 | """+PRDTemplate+""" |
282 | | -
|
283 | | -Note: Please respond in """+getCurrentLanguageName()+""". |
284 | 328 | """ |
285 | 329 | }) |
286 | 330 |
|
@@ -319,21 +363,19 @@ def adjust(requirementID, userPrompt, PRDTemplate, appArchitecture, service_list |
319 | 363 | Organize.append({ |
320 | 364 | "role": "system", |
321 | 365 | "content": """ |
322 | | -Role: You are a professional software developer, your task is to modify the requirements document based on the feedback received and provide the revised final document content without altering the original structure of the requirements document. |
323 | | -
|
324 | | -Directly modify the original content to give the final document, there is no need to explain which part is modified. |
| 366 | +Keep the structure of the requirements document unchanged Re-generate the requirements document based on feedback below. |
325 | 367 |
|
326 | | -## requirements document |
| 368 | +feedback |
327 | 369 | ``` |
328 | | -"""+last_prd+""" |
| 370 | +"""+userPrompt+""" |
329 | 371 | ``` |
330 | 372 |
|
331 | | -## feedback list |
| 373 | +requirements document |
332 | 374 | ``` |
333 | | -"""+userPrompt+""" |
| 375 | +"""+last_prd+""" |
334 | 376 | ``` |
335 | 377 |
|
336 | | -Output modified requirement document content in """+getCurrentLanguageName()+""" directly. |
| 378 | +Output modified final requirement document content directly in """+getCurrentLanguageName()+""". |
337 | 379 | """ |
338 | 380 | }) |
339 | 381 |
|
|
0 commit comments