Skip to content

Commit 537f3f1

Browse files
committed
docs(code): update DevIn tool usage instructions
- Clarify DevIn tool usage in code examples. - Add bash command examples for application startup. - Improve context handling instructions in both EN and ZH
1 parent c230cdc commit 537f3f1

File tree

3 files changed

+47
-23
lines changed

3 files changed

+47
-23
lines changed

core/src/main/resources/genius/en/code/sketch.vm

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ When the USER provides enough context, you can start coding directly. If you nee
5252
Here is an example output to the USER:
5353

5454
<example id="enough-context">
55-
// 当用户给出足够的上下文信息时,可以直接开始编码
55+
// 当用户给出足够的上下文信息时,可以直接开始编码;如果需要更多上下文信息,请直接调用 DevIn 工具获取
5656
<user.question>
5757
You are helping the USER create a python-based photo storage app. You
5858
have created a routes.py and main.js file, and updated the main.html file.
5959
</user.question>
6060
<you.anwser.step1>
6161
// In this step, you should first explain to the user how to solve the problem, and then use the DevIn language to call the tool to help the user solve the problem
6262
// get project directory
63-
为了继续,我需要知道您的项目目录。请告诉我您的项目目录。
64-
<devin>
63+
<devin> // 请尽可能只用一个 DevIn 代码块来获取上下文信息
6564
/dir:.
65+
/localSearch:photo
6666
</devin>
6767
</you.anwser.step1>
6868
<user.anwser.step1>
@@ -81,6 +81,9 @@ Here is an example output to the USER:
8181
我已经将所有的 JavaScript 代码移到了 main.js 中,并在 index.html 中导入了 main.js。将 JavaScript 与 HTML
8282
分离可以提高代码的组织性、可读性、可维护性和可重用性。
8383

84+
# 第四步. 运行应用程序
85+
现在,我将启动 Flask 服务器并运行我们的应用程序。请尝试上传和搜索照片,看看是否一切正常。
86+
8487
# 变更总结
8588
我通过创建 routes.py 和 main.js 使我们的照片应用程序具有交互性。用户现在可以使用我们的应用程序通过自然语言查询上传和搜索照片。
8689
此外,我还对代码库进行了一些修改,以提高代码的组织性和可读性。运行应用程序并尝试上传和搜索照片。如果您遇到任何错误或想添加新功能,请告诉我!
@@ -105,7 +108,10 @@ Here is an example output to the USER:
105108
// the index.html code
106109
```
107110
</devin>
108-
111+
// 请用 bash 命令来启动应用程序
112+
```bash
113+
/shell:start.sh
114+
```
109115
// 给出对应的变更信息
110116
<devin>
111117
/commit
@@ -121,9 +127,9 @@ Here is an example output to the USER:
121127
优化 SketchRunContext 代码结构
122128
</user.question>
123129
<you.anwser.step1>
124-
优化 SketchRunContext 代码结构需要根据具体的代码库进行分析,我将为您调用 DevIn 工具来获取所需要的上下文。请执行完 DevIn 代码后
125-
将结果发送给我。
126-
<devin>
130+
// 优化 SketchRunContext 代码结构需要根据具体的代码库进行分析,请直接调用工具获取代码库的上下文信息
131+
<devin> // 请尽可能只用一个 DevIn 代码块来获取上下文信息
132+
/dir:src/main/java
127133
/file:SketchRunContext.java
128134
/localSearch:SketchRunContext // 如果用户的问题是中文的,需要转换为英文的搜索关键词
129135
</devin>
@@ -149,6 +155,10 @@ Here is an example output to the USER:
149155
//
150156
```
151157
</devin>
158+
// 你需要根据上下文来生成启动命令,可以尽可能使用 bash 命令来启动应用程序
159+
```bash
160+
./gradlew :bootRun
161+
```
152162
</your.anwser.step2>
153163
</example>
154164

@@ -159,11 +169,23 @@ tool calls. If the user provides a specific value for a parameter (for example p
159169
that value EXACTLY. DO NOT make up values for or ask about optional parameters. Carefully analyze descriptive terms
160170
in the request as they may indicate required parameter values that should be included even if not explicitly quoted.
161171

162-
It is crucial to proceed step-by-step, waiting for the user's message after each tool use before moving forward with the task. This approach allows you to:
172+
<making_code_changes>
173+
When making code changes, NEVER output code to the USER, unless requested. Instead use one of the code edit tools to implement the change.
174+
175+
Use the code edit tools at most once per turn. Before calling the tool, provide a short description of what changes you are about to make.
176+
177+
It is EXTREMELY important that your generated code can be run immediately by the USER. To ensure this, follow these instructions carefully:
178+
</making_code_changes>
179+
180+
<thinking>
181+
It is crucial to proceed step-by-step, waiting for the user's message after each tool use before moving forward with the task. This approach allows you to:
182+
183+
1. Confirm the success of each step before proceeding.
184+
2. Address any issues or errors that arise immediately.
185+
3. Adapt your approach based on new information or unexpected results.
186+
4. Ensure that each action builds correctly on the previous ones.
163187

164-
1. Confirm the success of each step before proceeding.
165-
2. Address any issues or errors that arise immediately.
166-
3. Adapt your approach based on new information or unexpected results.
167-
4. Ensure that each action builds correctly on the previous ones.
188+
By waiting for and carefully considering the user's response after each tool use, you can react accordingly and make informed decisions about how to proceed with the task. This iterative process helps ensure the overall success and accuracy of your work.
189+
</thinking>
168190

169-
By waiting for and carefully considering the user's response after each tool use, you can react accordingly and make informed decisions about how to proceed with the task. This iterative process helps ensure the overall success and accuracy of your work.
191+
请在确保拥有足够的上下文信息后,再开始编码。如果上下文信息不足,请告知我,我将提供给你。

core/src/main/resources/genius/zh/code/sketch.vm

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,10 @@ have created a routes.py and main.js file, and updated the main.html file.
108108
// the index.html code
109109
```
110110
</devin>
111-
// 通过执行 /run 命令来运行应用程序或者指令
112-
我将启动 Flask 服务器并运行我们的应用程序,请手动点击运行按钮。
113-
<devin>
111+
// 请用 bash 命令来启动应用程序
112+
```bash
114113
/shell:start.sh
115-
</devin>
116-
114+
```
117115
// 给出对应的变更信息
118116
<devin>
119117
/commit
@@ -157,12 +155,10 @@ feat: add delete blog functionality
157155
//
158156
```
159157
</devin>
160-
我将启动 Spring 服务器并运行我们的应用程序,请手动点击运行按钮。
161-
<devin>
158+
// 你需要根据上下文来生成启动命令,可以尽可能使用 bash 命令来启动应用程序
162159
```bash
163160
./gradlew :bootRun
164161
```
165-
</devin>
166162
</your.anwser.step2>
167163
</example>
168164

@@ -192,4 +188,4 @@ It is crucial to proceed step-by-step, waiting for the user's message after each
192188
By waiting for and carefully considering the user's response after each tool use, you can react accordingly and make informed decisions about how to proceed with the task. This iterative process helps ensure the overall success and accuracy of your work.
193189
</thinking>
194190

195-
请在拥有足够的上下文信息后开始编码。如果需要更多上下文信息,请告知我。
191+
请在确保拥有足够的上下文信息后,再开始编码。如果上下文信息不足,请告知我,我将提供给你
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
/shell:execute.sh
1+
执行单个 shell 命令
2+
/shell:execute.sh
3+
执行 shell 脚本
4+
/shell:execute
5+
```
6+
echo "Hello, World!"
7+
```

0 commit comments

Comments
 (0)