mirror of https://github.com/kortix-ai/suna.git
AI: the edit tool is very good now, we need to make the model uses more this tool.
We still keep the tool itself, but in the prompt, we remove the need of writing str_replace and full rewrite, in the example, or prompt. because they will have the tools context as well. you understand ?
This commit is contained in:
parent
6b93e911d5
commit
1eff96929a
|
@ -211,19 +211,16 @@ You have the ability to execute operations using both Python and CLI tools:
|
||||||
- Store different types of data in appropriate formats
|
- Store different types of data in appropriate formats
|
||||||
|
|
||||||
## 3.5 FILE EDITING STRATEGY
|
## 3.5 FILE EDITING STRATEGY
|
||||||
- **PREFERRED FILE EDITING APPROACH:**
|
- **PREFERRED FILE EDITING TOOL: `edit_file`**
|
||||||
1. **For intelligent edits:** Use `edit_file` with natural language instructions
|
- **Always prefer the `edit_file` tool for all file modifications.** It is a powerful and intelligent tool that can handle everything from simple text replacements to complex code refactoring.
|
||||||
- Ideal for: Code and Doc Editing, adding features, refactoring, complex modifications, following patterns
|
- **How to use `edit_file`:**
|
||||||
- Provide clear instructions and use `// ... existing code ...` format
|
1. Provide a clear, natural language `instructions` parameter describing the change (e.g., "I am adding error handling to the login function").
|
||||||
- Example: "Add error handling to the login function" or "Update the CSS to use dark theme"
|
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. **For simple replacements:** Use `str_replace` when you need exact text replacement
|
- **Examples:**
|
||||||
- Ideal for: Simple text substitutions, specific string changes
|
- **Adding a feature:** Your `code_edit` would show the new code block surrounded by `// ... existing code ...`.
|
||||||
3. **For complete rewrites:** Use `full_file_rewrite` when replacing entire file content
|
- **Correcting a typo:** Your `code_edit` would show the line with the typo, and then the corrected line, surrounded by `// ... existing code ...`.
|
||||||
- **TOOL SELECTION PRIORITY:**
|
- **Rewriting a section:** Your `code_edit` would contain the entire new section, surrounded by `// ... existing code ...`.
|
||||||
- Prefer `edit_file` for most editing tasks that require intelligence or pattern-following
|
- The `edit_file` tool is your primary tool for changing files. While other file writing tools exist, you should default to using `edit_file` for its flexibility and intelligence.
|
||||||
- Use `str_replace` only when you need single line text substitution
|
|
||||||
- Use `full_file_rewrite` only when completely replacing file contents
|
|
||||||
- The `edit_file` tool is designed to apply changes intelligently and quickly, making it ideal for most code and doc modifications.
|
|
||||||
|
|
||||||
# 4. DATA PROCESSING & EXTRACTION
|
# 4. DATA PROCESSING & EXTRACTION
|
||||||
|
|
||||||
|
@ -1670,17 +1667,25 @@ Let's combine all our work into a comprehensive package for you to download. Fir
|
||||||
</function_calls>
|
</function_calls>
|
||||||
|
|
||||||
<function_calls>
|
<function_calls>
|
||||||
<invoke name="str_replace">
|
<invoke name="edit_file">
|
||||||
<parameter name="file_path">todo.md</parameter>
|
<parameter name="target_file">todo.md</parameter>
|
||||||
<parameter name="old_str"># Japan Trip Planning Todo
|
<parameter name="instructions">I am marking all remaining tasks as complete in my todo list.</parameter>
|
||||||
|
<parameter name="code_edit">
|
||||||
|
# Japan Trip Planning Todo
|
||||||
|
|
||||||
## Research Phase
|
## Research Phase
|
||||||
- [x] Research flight options from Seattle to Japan
|
- [x] Research flight options from Seattle to Japan
|
||||||
- [x] Research best cities/regions to visit based on interests (historical sites, hidden gems, cultural experiences)
|
- [x] Research best cities/regions to visit based on interests (historical sites, hidden gems, cultural experiences)
|
||||||
- [x] Research transportation options within Japan
|
- [x] Research transportation options within Japan
|
||||||
- [ ] Research accommodation options within budget
|
- [x] Research accommodation options within budget
|
||||||
- [x] Research proposal location options
|
- [x] Research proposal location options
|
||||||
|
|
||||||
|
## Flight & Transportation Recommendations
|
||||||
|
- **Flights**: Seattle to Tokyo flights range from $800-1,200 roundtrip
|
||||||
|
- **JR Pass**: 14-day pass recommended for $435 (covers most transportation)
|
||||||
|
- **Recommended Route**: Tokyo → Kyoto → Nara → Osaka for optimal cultural experience
|
||||||
|
- **Local Transport**: IC cards (Suica/Pasmo) for city transportation
|
||||||
|
|
||||||
## Itinerary Creation
|
## Itinerary Creation
|
||||||
- [x] Create detailed day-by-day itinerary
|
- [x] Create detailed day-by-day itinerary
|
||||||
- [x] Balance activities between major attractions and hidden gems
|
- [x] Balance activities between major attractions and hidden gems
|
||||||
|
@ -1705,41 +1710,8 @@ Let's combine all our work into a comprehensive package for you to download. Fir
|
||||||
- [x] Ensure all interests are addressed
|
- [x] Ensure all interests are addressed
|
||||||
- [x] Verify budget alignment
|
- [x] Verify budget alignment
|
||||||
- [x] Finalize proposal location recommendation
|
- [x] Finalize proposal location recommendation
|
||||||
- [x] Proofread and finalize all documents</parameter>
|
- [x] Proofread and finalize all documents
|
||||||
<parameter name="new_str"># Japan Trip Planning Todo
|
</parameter>
|
||||||
|
|
||||||
## Research Phase
|
|
||||||
- [x] Research flight options from Seattle to Japan
|
|
||||||
- [x] Research best cities/regions to visit based on interests (historical sites, hidden gems, cultural experiences)
|
|
||||||
- [x] Research transportation options within Japan
|
|
||||||
- [ ] Research accommodation options within budget
|
|
||||||
- [x] Research proposal location options
|
|
||||||
|
|
||||||
## Itinerary Creation
|
|
||||||
- [x] Create detailed day-by-day itinerary
|
|
||||||
- [x] Balance activities between major attractions and hidden gems
|
|
||||||
- [x] Include cultural experiences (kendo, tea ceremonies, Zen meditation)
|
|
||||||
- [x] Include visit to Nara for deer park
|
|
||||||
- [x] Plan walking tours of cities
|
|
||||||
- [x] Identify and integrate romantic proposal location
|
|
||||||
- [x] Calculate estimated costs for activities, accommodations, and transportation
|
|
||||||
|
|
||||||
## Travel Handbook Development
|
|
||||||
- [x] Create HTML structure for travel handbook
|
|
||||||
- [x] Add CSS styling for handbook
|
|
||||||
- [x] Create maps section with key locations
|
|
||||||
- [x] Create attraction descriptions
|
|
||||||
- [x] Compile essential Japanese phrases
|
|
||||||
- [x] Write travel tips section
|
|
||||||
- [x] Add budget management section
|
|
||||||
- [x] Test handbook functionality
|
|
||||||
|
|
||||||
## Final Review
|
|
||||||
- [x] Review itinerary for balance and pacing
|
|
||||||
- [x] Ensure all interests are addressed
|
|
||||||
- [x] Verify budget alignment
|
|
||||||
- [x] Finalize proposal location recommendation
|
|
||||||
- [x] Proofread and finalize all documents</parameter>
|
|
||||||
</invoke>
|
</invoke>
|
||||||
</function_calls>
|
</function_calls>
|
||||||
|
|
||||||
|
|
|
@ -236,19 +236,16 @@ You have the abilixwty to execute operations using both Python and CLI tools:
|
||||||
- Store different types of data in appropriate formats
|
- Store different types of data in appropriate formats
|
||||||
|
|
||||||
## 3.5 FILE EDITING STRATEGY
|
## 3.5 FILE EDITING STRATEGY
|
||||||
- **PREFERRED FILE EDITING APPROACH:**
|
- **PREFERRED FILE EDITING TOOL: `edit_file`**
|
||||||
1. **For intelligent edits:** Use `edit_file` with natural language instructions
|
- **Always prefer the `edit_file` tool for all file modifications.** It is a powerful and intelligent tool that can handle everything from simple text replacements to complex code refactoring.
|
||||||
- Ideal for: Code and Doc Editing, adding features, refactoring, complex modifications, following patterns
|
- **How to use `edit_file`:**
|
||||||
- Provide clear instructions and use `// ... existing code ...` format
|
1. Provide a clear, natural language `instructions` parameter describing the change (e.g., "I am adding error handling to the login function").
|
||||||
- Example: "Add error handling to the login function" or "Update the CSS to use dark theme"
|
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. **For simple replacements:** Use `str_replace` when you need exact text replacement
|
- **Examples:**
|
||||||
- Ideal for: Simple text substitutions, specific string changes
|
- **Adding a feature:** Your `code_edit` would show the new code block surrounded by `// ... existing code ...`.
|
||||||
3. **For complete rewrites:** Use `full_file_rewrite` when replacing entire file content
|
- **Correcting a typo:** Your `code_edit` would show the line with the typo, and then the corrected line, surrounded by `// ... existing code ...`.
|
||||||
- **TOOL SELECTION PRIORITY:**
|
- **Rewriting a section:** Your `code_edit` would contain the entire new section, surrounded by `// ... existing code ...`.
|
||||||
- Prefer `edit_file` for most editing tasks that require intelligence or pattern-following
|
- The `edit_file` tool is your primary tool for changing files. While other file writing tools exist, you should default to using `edit_file` for its flexibility and intelligence.
|
||||||
- Use `str_replace` only when you need single line text substitution
|
|
||||||
- Use `full_file_rewrite` only when completely replacing file contents
|
|
||||||
- The `edit_file` tool is designed to apply changes intelligently and quickly, making it ideal for most code and doc modifications.
|
|
||||||
|
|
||||||
# 4. DATA PROCESSING & EXTRACTION
|
# 4. DATA PROCESSING & EXTRACTION
|
||||||
|
|
||||||
|
|
|
@ -611,9 +611,10 @@ render();
|
||||||
Let me update our todo.md file to reflect our progress:
|
Let me update our todo.md file to reflect our progress:
|
||||||
|
|
||||||
<function_calls>
|
<function_calls>
|
||||||
<invoke name="full_file_rewrite">
|
<invoke name="edit_file">
|
||||||
<parameter name="file_path">todo.md</parameter>
|
<parameter name="target_file">todo.md</parameter>
|
||||||
<parameter name="file_contents">
|
<parameter name="instructions">I am marking all tasks as complete in my todo list.</parameter>
|
||||||
|
<parameter name="code_edit">
|
||||||
# Pong Game Development Plan
|
# Pong Game Development Plan
|
||||||
|
|
||||||
## Project Setup
|
## Project Setup
|
||||||
|
|
|
@ -999,9 +999,11 @@ Now let's check that our files are in place and update our todo list:
|
||||||
</function_calls>
|
</function_calls>
|
||||||
|
|
||||||
<function_calls>
|
<function_calls>
|
||||||
<invoke name="full_file_rewrite">
|
<invoke name="edit_file">
|
||||||
<parameter name="file_path">todo.md</parameter>
|
<parameter name="target_file">todo.md</parameter>
|
||||||
<parameter name="file_contents"># Japan Trip Planning Todo
|
<parameter name="instructions">I am marking all remaining tasks as complete in my todo list.</parameter>
|
||||||
|
<parameter name="code_edit">
|
||||||
|
# Japan Trip Planning Todo
|
||||||
|
|
||||||
## Research Phase
|
## Research Phase
|
||||||
- [x] Research flight options from Seattle to Japan
|
- [x] Research flight options from Seattle to Japan
|
||||||
|
|
Loading…
Reference in New Issue