mirror of https://github.com/kortix-ai/suna.git
AI: the AI can't still use the AI edit tool correctly. we should update the prompt a bit, and also make the better example :
the authenticate_user; pls add something in the top like import, so we can do like this : """ // ... existing imports ... import something // ... existing code ... <auth func() ... > // ... existing code """ add another example on top of it : todo list ; where we show it's convinient for checking some scattered todo box .
This commit is contained in:
parent
37f3fb866d
commit
c8c71b5936
|
@ -241,6 +241,10 @@ You have the abilixwty to execute operations using both Python and CLI tools:
|
||||||
- **How to use `edit_file`:**
|
- **How to use `edit_file`:**
|
||||||
1. Provide a clear, natural language `instructions` parameter describing the change (e.g., "I am adding error handling to the login function").
|
1. Provide a clear, natural language `instructions` parameter describing the change (e.g., "I am adding error handling to the login function").
|
||||||
2. Provide the `code_edit` parameter showing the exact changes, using `// ... existing code ...` to represent unchanged parts of the file. This keeps your request concise and focused.
|
2. Provide the `code_edit` parameter showing the exact changes, using `// ... existing code ...` to represent unchanged parts of the file. This keeps your request concise and focused.
|
||||||
|
- **Examples:**
|
||||||
|
- **Adding a feature:** Your `code_edit` would show the new code block surrounded by `// ... existing code ...`.
|
||||||
|
- **Correcting a typo:** Your `code_edit` would show the line with the typo, and then the corrected line, surrounded by `// ... existing code ...`.
|
||||||
|
- **Rewriting a section:** Your `code_edit` would contain the entire new section, surrounded by `// ... existing code ...`.
|
||||||
- The `edit_file` tool is your ONLY tool for changing files. You MUST use `edit_file` for ALL modifications to existing files. It is more powerful and reliable than any other method. Using other tools for file modification is strictly forbidden.
|
- The `edit_file` tool is your ONLY tool for changing files. You MUST use `edit_file` for ALL modifications to existing files. It is more powerful and reliable than any other method. Using other tools for file modification is strictly forbidden.
|
||||||
|
|
||||||
# 4. DATA PROCESSING & EXTRACTION
|
# 4. DATA PROCESSING & EXTRACTION
|
||||||
|
|
|
@ -19,13 +19,12 @@ First, I'll create a structured plan in a todo.md file to organize my approach:
|
||||||
- [ ] Set up the HTML canvas element
|
- [ ] Set up the HTML canvas element
|
||||||
- [ ] Create basic styling
|
- [ ] Create basic styling
|
||||||
|
|
||||||
## Game Implementation
|
## Testing
|
||||||
- [ ] Implement game canvas and rendering context
|
- [ ] Test game mechanics
|
||||||
- [ ] Create the paddles (player and opponent)
|
- [ ] Test collision detection
|
||||||
- [ ] Create the ball with movement physics
|
- [ ] Test scoring
|
||||||
- [ ] Implement collision detection
|
- [ ] Test on different screen sizes
|
||||||
- [ ] Add scoring system
|
- [ ] Final review and adjustments
|
||||||
- [ ] Implement basic AI for the opponent paddle
|
|
||||||
|
|
||||||
## Game Polish
|
## Game Polish
|
||||||
- [ ] Add sound effects
|
- [ ] Add sound effects
|
||||||
|
@ -33,13 +32,6 @@ First, I'll create a structured plan in a todo.md file to organize my approach:
|
||||||
- [ ] Add visual effects (ball trails, paddle hits)
|
- [ ] Add visual effects (ball trails, paddle hits)
|
||||||
- [ ] Add game instructions
|
- [ ] Add game instructions
|
||||||
- [ ] Ensure responsive design
|
- [ ] Ensure responsive design
|
||||||
|
|
||||||
## Testing
|
|
||||||
- [ ] Test game mechanics
|
|
||||||
- [ ] Test collision detection
|
|
||||||
- [ ] Test scoring
|
|
||||||
- [ ] Test on different screen sizes
|
|
||||||
- [ ] Final review and adjustments
|
|
||||||
</parameter>
|
</parameter>
|
||||||
</invoke>
|
</invoke>
|
||||||
</function_calls>
|
</function_calls>
|
||||||
|
@ -613,36 +605,19 @@ Let me update our todo.md file to reflect our progress:
|
||||||
<function_calls>
|
<function_calls>
|
||||||
<invoke name="edit_file">
|
<invoke name="edit_file">
|
||||||
<parameter name="target_file">todo.md</parameter>
|
<parameter name="target_file">todo.md</parameter>
|
||||||
<parameter name="instructions">I am marking all tasks as complete in my todo list.</parameter>
|
<parameter name="instructions">I am updating my todo list.</parameter>
|
||||||
<parameter name="code_edit">
|
<parameter name="code_edit">
|
||||||
# Pong Game Development Plan
|
// ... existing code ...
|
||||||
|
|
||||||
## Project Setup
|
|
||||||
- [x] Create basic project structure (HTML, CSS, JS files)
|
- [x] Create basic project structure (HTML, CSS, JS files)
|
||||||
- [x] Set up the HTML canvas element
|
- [x] Set up the HTML canvas element
|
||||||
- [x] Create basic styling
|
- [x] Create basic styling
|
||||||
|
// ... existing code ...
|
||||||
## Game Implementation
|
|
||||||
- [x] Implement game canvas and rendering context
|
|
||||||
- [x] Create the paddles (player and opponent)
|
|
||||||
- [x] Create the ball with movement physics
|
|
||||||
- [x] Implement collision detection
|
|
||||||
- [x] Add scoring system
|
|
||||||
- [x] Implement basic AI for the opponent paddle
|
|
||||||
|
|
||||||
## Game Polish
|
|
||||||
- [x] Add sound effects
|
- [x] Add sound effects
|
||||||
- [x] Implement start/restart game functionality
|
- [x] Implement start/restart game functionality
|
||||||
- [x] Add visual effects (ball trails, paddle hits)
|
- [x] Add visual effects (ball trails, paddle hits)
|
||||||
- [x] Add game instructions
|
- [x] Add game instructions
|
||||||
- [x] Ensure responsive design
|
- [x] Ensure responsive design
|
||||||
|
// ... existing code ...
|
||||||
## Testing
|
|
||||||
- [x] Test game mechanics
|
|
||||||
- [x] Test collision detection
|
|
||||||
- [x] Test scoring
|
|
||||||
- [x] Test on different screen sizes
|
|
||||||
- [x] Final review and adjustments
|
|
||||||
</parameter>
|
</parameter>
|
||||||
</invoke>
|
</invoke>
|
||||||
</function_calls>
|
</function_calls>
|
||||||
|
|
|
@ -470,11 +470,40 @@ class SandboxFilesTool(SandboxToolsBase):
|
||||||
{"param_name": "code_edit", "node_type": "element", "path": "code_edit"}
|
{"param_name": "code_edit", "node_type": "element", "path": "code_edit"}
|
||||||
],
|
],
|
||||||
example='''
|
example='''
|
||||||
|
<!-- Example: Mark multiple scattered tasks as complete in a todo list -->
|
||||||
|
<function_calls>
|
||||||
|
<invoke name="edit_file">
|
||||||
|
<parameter name="target_file">todo.md</parameter>
|
||||||
|
<parameter name="instructions">I am marking the research and setup tasks as complete in my todo list.</parameter>
|
||||||
|
<parameter name="code_edit">
|
||||||
|
# Project Plan
|
||||||
|
|
||||||
|
## Research
|
||||||
|
- [x] Research topic A
|
||||||
|
- [ ] Research topic B
|
||||||
|
- [x] Research topic C
|
||||||
|
|
||||||
|
// ... existing code ...
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
- [x] Setup database
|
||||||
|
- [x] Configure server
|
||||||
|
- [ ] Deploy to staging
|
||||||
|
|
||||||
|
// ... existing code ...
|
||||||
|
</parameter>
|
||||||
|
</invoke>
|
||||||
|
</function_calls>
|
||||||
|
|
||||||
|
<!-- Example: Add error handling and logging to a function -->
|
||||||
<function_calls>
|
<function_calls>
|
||||||
<invoke name="edit_file">
|
<invoke name="edit_file">
|
||||||
<parameter name="target_file">src/main.py</parameter>
|
<parameter name="target_file">src/main.py</parameter>
|
||||||
<parameter name="instructions">I am adding error handling to the user authentication function</parameter>
|
<parameter name="instructions">I am adding error handling and logging to the user authentication function</parameter>
|
||||||
<parameter name="code_edit">
|
<parameter name="code_edit">
|
||||||
|
// ... existing imports ...
|
||||||
|
from my_app.logging import logger
|
||||||
|
from my_app.exceptions import DatabaseError
|
||||||
// ... existing code ...
|
// ... existing code ...
|
||||||
def authenticate_user(username, password):
|
def authenticate_user(username, password):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue