feature/web-search-and-cron-improvements #2
@ -46,6 +46,7 @@ class ExecTool(Tool):
|
||||
IMPORTANT:
|
||||
- For READING files (including PDFs, text files, etc.), ALWAYS use read_file FIRST. Do NOT use exec to read files.
|
||||
- Only use exec for complex data processing AFTER you have already read the file content using read_file.
|
||||
- For git commands (git commit, git push, git status, etc.), ALWAYS use exec tool, NOT write_file or edit_file.
|
||||
|
||||
For data analysis tasks (Excel, CSV, JSON files), use Python with pandas:
|
||||
- Excel files: python3 -c "import pandas as pd; df = pd.read_excel('file.xlsx'); result = df['Column Name'].sum(); print(result)"
|
||||
@ -53,7 +54,13 @@ For data analysis tasks (Excel, CSV, JSON files), use Python with pandas:
|
||||
- NEVER use pandas/openpyxl as command-line tools (they don't exist)
|
||||
- NEVER use non-existent tools like csvcalc, xlsxcalc, etc.
|
||||
- For calculations: Use pandas operations like .sum(), .mean(), .max(), etc.
|
||||
- For total inventory value: (df['Unit Price'] * df['Quantity']).sum()"""
|
||||
- For total inventory value: (df['Unit Price'] * df['Quantity']).sum()
|
||||
|
||||
For git operations:
|
||||
- git commit: exec(command="git commit -m 'message'")
|
||||
- git status: exec(command="git status")
|
||||
- git push: exec(command="git push")
|
||||
- NEVER use write_file or edit_file for git commands"""
|
||||
|
||||
@property
|
||||
def parameters(self) -> dict[str, Any]:
|
||||
|
||||
@ -37,6 +37,26 @@ curl -H "Authorization: token $NANOBOT_GITLE_TOKEN" "http://10.0.30.169:3000/api
|
||||
- Use tools to help accomplish tasks
|
||||
- Remember important information in your memory files
|
||||
|
||||
## Git Operations
|
||||
|
||||
**CRITICAL**: When user asks to commit, push, or perform git operations:
|
||||
- **ALWAYS use the `exec` tool** to run git commands
|
||||
- **NEVER use `write_file` or `edit_file`** for git commands
|
||||
- Git commands are shell commands and must be executed, not written to files
|
||||
|
||||
**Examples:**
|
||||
- User: "commit with message 'Fix bug'" → `exec(command="git commit -m 'Fix bug'")`
|
||||
- User: "commit the staged files" → `exec(command="git commit -m 'your message here'")`
|
||||
- User: "push to remote" → `exec(command="git push")`
|
||||
- User: "check git status" → `exec(command="git status")`
|
||||
|
||||
**WRONG (will not work):**
|
||||
- `write_file(path="git commit -m 'message'", content="...")` ❌
|
||||
- `edit_file(path="git commit", ...)` ❌
|
||||
|
||||
**CORRECT:**
|
||||
- `exec(command="git commit -m 'Fix HTTPS to HTTP conversion for Gitea API'")` ✅
|
||||
|
||||
## When NOT to Use Tools
|
||||
|
||||
**For simple acknowledgments, respond naturally and conversationally - no tools needed.**
|
||||
|
||||
@ -42,6 +42,14 @@ exec(command: str, working_dir: str = None) -> str
|
||||
- Output is truncated at 10,000 characters
|
||||
- Optional `restrictToWorkspace` config to limit paths
|
||||
|
||||
**Git Commands:**
|
||||
- **ALWAYS use exec for git commands** (git commit, git push, git status, etc.)
|
||||
- **NEVER use write_file or edit_file for git commands**
|
||||
- Examples:
|
||||
- `exec(command="git commit -m 'Fix bug'")`
|
||||
- `exec(command="git status")`
|
||||
- `exec(command="git push")`
|
||||
|
||||
## Web Access
|
||||
|
||||
### web_search
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user