4 Commits

Author SHA1 Message Date
Grail Finder
01d8bcdbf5 Enha: avoid \n\n in tool collapse 2026-03-01 12:28:23 +03:00
Grail Finder
f6a395bce9 Fix: todo_update 2026-03-01 12:16:17 +03:00
Grail Finder
dc34c63256 Feat: handle llm's cd use 2026-03-01 11:44:43 +03:00
Grail Finder
cdfccf9a24 Enha (llama.cpp): show loaded model on startup 2026-03-01 08:22:02 +03:00
7 changed files with 121 additions and 85 deletions

32
bot.go
View File

@@ -379,22 +379,22 @@ func fetchLCPModels() ([]string, error) {
// fetchLCPModelsWithLoadStatus returns models with "(loaded)" indicator for loaded models // fetchLCPModelsWithLoadStatus returns models with "(loaded)" indicator for loaded models
func fetchLCPModelsWithLoadStatus() ([]string, error) { func fetchLCPModelsWithLoadStatus() ([]string, error) {
models, err := fetchLCPModelsWithStatus() modelList, err := fetchLCPModelsWithStatus()
if err != nil { if err != nil {
return nil, err return nil, err
} }
result := make([]string, 0, len(models.Data)) result := make([]string, 0, len(modelList.Data))
li := 0 // loaded index li := 0 // loaded index
for i, m := range models.Data { for i, m := range modelList.Data {
modelName := m.ID modelName := m.ID
if m.Status.Value == "loaded" { if m.Status.Value == "loaded" {
modelName = "(loaded) " + modelName modelName = models.LoadedMark + modelName
li = i li = i
} }
result = append(result, modelName) result = append(result, modelName)
} }
if li == 0 { if li == 0 {
return result, nil // no loaded models return result, nil // no loaded modelList
} }
loadedModel := result[li] loadedModel := result[li]
result = append(result[:li], result[li+1:]...) result = append(result[:li], result[li+1:]...)
@@ -1207,11 +1207,11 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string {
// This is a tool call indicator - show collapsed // This is a tool call indicator - show collapsed
if toolCollapsed { if toolCollapsed {
toolName := messages[i].ToolCall.Name toolName := messages[i].ToolCall.Name
resp[i] = fmt.Sprintf("%s\n[yellow::i][tool call: %s (press Ctrl+T to expand)][-:-:-]\n", icon, toolName) resp[i] = strings.ReplaceAll(fmt.Sprintf("%s\n%s\n[yellow::i][tool call: %s (press Ctrl+T to expand)][-:-:-]\n", icon, messages[i].GetText(), toolName), "\n\n", "\n")
} else { } else {
// Show full tool call info // Show full tool call info
toolName := messages[i].ToolCall.Name toolName := messages[i].ToolCall.Name
resp[i] = fmt.Sprintf("%s\n%s\n[yellow::i][tool call: %s][-:-:-]\nargs: %s\nid: %s\n", icon, messages[i].GetText(), toolName, messages[i].ToolCall.Args, messages[i].ToolCall.ID) resp[i] = strings.ReplaceAll(fmt.Sprintf("%s\n%s\n[yellow::i][tool call: %s][-:-:-]\nargs: %s\nid: %s\n", icon, messages[i].GetText(), toolName, messages[i].ToolCall.Args, messages[i].ToolCall.ID), "\n\n", "\n")
} }
continue continue
} }
@@ -1323,11 +1323,27 @@ func updateModelLists() {
} }
// if llama.cpp started after gf-lt? // if llama.cpp started after gf-lt?
localModelsMu.Lock() localModelsMu.Lock()
LocalModels, err = fetchLCPModels() LocalModels, err = fetchLCPModelsWithLoadStatus()
localModelsMu.Unlock() localModelsMu.Unlock()
if err != nil { if err != nil {
logger.Warn("failed to fetch llama.cpp models", "error", err) logger.Warn("failed to fetch llama.cpp models", "error", err)
} }
// set already loaded model in llama.cpp
if strings.Contains(cfg.CurrentAPI, "localhost") || strings.Contains(cfg.CurrentAPI, "127.0.0.1") {
localModelsMu.Lock()
defer localModelsMu.Unlock()
for i := range LocalModels {
if strings.Contains(LocalModels[i], models.LoadedMark) {
m := strings.TrimPrefix(LocalModels[i], models.LoadedMark)
cfg.CurrentModel = m
chatBody.Model = m
cachedModelColor = "green"
updateStatusLine()
app.Draw()
return
}
}
}
} }
func refreshLocalModelsIfEmpty() { func refreshLocalModelsIfEmpty() {

View File

@@ -27,7 +27,6 @@ func startModelColorUpdater() {
go func() { go func() {
ticker := time.NewTicker(5 * time.Second) ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop() defer ticker.Stop()
// Initial check // Initial check
updateCachedModelColor() updateCachedModelColor()
for range ticker.C { for range ticker.C {
@@ -42,7 +41,6 @@ func updateCachedModelColor() {
cachedModelColor = "orange" cachedModelColor = "orange"
return return
} }
// Check if model is loaded // Check if model is loaded
loaded, err := isModelLoaded(chatBody.Model) loaded, err := isModelLoaded(chatBody.Model)
if err != nil { if err != nil {

12
models/consts.go Normal file
View File

@@ -0,0 +1,12 @@
package models
const (
LoadedMark = "(loaded) "
)
type APIType int
const (
APITypeChat APIType = iota
APITypeCompletion
)

View File

@@ -519,24 +519,6 @@ type OpenAIReq struct {
// === // ===
// type LLMModels struct {
// Object string `json:"object"`
// Data []struct {
// ID string `json:"id"`
// Object string `json:"object"`
// Created int `json:"created"`
// OwnedBy string `json:"owned_by"`
// Meta struct {
// VocabType int `json:"vocab_type"`
// NVocab int `json:"n_vocab"`
// NCtxTrain int `json:"n_ctx_train"`
// NEmbd int `json:"n_embd"`
// NParams int64 `json:"n_params"`
// Size int64 `json:"size"`
// } `json:"meta"`
// } `json:"data"`
// }
type LlamaCPPReq struct { type LlamaCPPReq struct {
Model string `json:"model"` Model string `json:"model"`
Stream bool `json:"stream"` Stream bool `json:"stream"`
@@ -641,10 +623,3 @@ type ChatRoundReq struct {
Regen bool Regen bool
Resume bool Resume bool
} }
type APIType int
const (
APITypeChat APIType = iota
APITypeCompletion
)

View File

@@ -1,6 +1,7 @@
package main package main
import ( import (
"gf-lt/models"
"slices" "slices"
"strings" "strings"
@@ -51,7 +52,7 @@ func showModelSelectionPopup() {
// Find the current model index to set as selected // Find the current model index to set as selected
currentModelIndex := -1 currentModelIndex := -1
for i, model := range modelList { for i, model := range modelList {
if strings.TrimPrefix(model, "(loaded) ") == chatBody.Model { if strings.TrimPrefix(model, models.LoadedMark) == chatBody.Model {
currentModelIndex = i currentModelIndex = i
} }
modelListWidget.AddItem(model, "", 0, nil) modelListWidget.AddItem(model, "", 0, nil)
@@ -61,7 +62,7 @@ func showModelSelectionPopup() {
modelListWidget.SetCurrentItem(currentModelIndex) modelListWidget.SetCurrentItem(currentModelIndex)
} }
modelListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) { modelListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
modelName := strings.TrimPrefix(mainText, "(loaded) ") modelName := strings.TrimPrefix(mainText, models.LoadedMark)
chatBody.Model = modelName chatBody.Model = modelName
cfg.CurrentModel = chatBody.Model cfg.CurrentModel = chatBody.Model
pages.RemovePage("modelSelectionPopup") pages.RemovePage("modelSelectionPopup")

View File

@@ -1,6 +1,6 @@
{ {
"sys_prompt": "You are an expert software engineering assistant. Your goal is to help users with coding tasks, debugging, refactoring, and software development.\n\n## Core Principles\n1. **Security First**: Never expose secrets, keys, or credentials. Never commit sensitive data.\n2. **No Git Actions**: You can READ git info (status, log, diff) for context, but NEVER perform git actions (commit, add, push, checkout, reset, rm, etc.). Let the user handle all git operations.\n3. **Explore Before Execute**: Always understand the codebase structure before making changes.\n4. **Follow Conventions**: Match existing code style, patterns, and frameworks used in the project.\n5. **Be Concise**: Minimize output tokens while maintaining quality. Avoid unnecessary explanations.\n\n## Workflow for Complex Tasks\nFor multi-step tasks, ALWAYS use the todo system to track progress:\n\n1. **Create Todo List**: At the start of complex tasks, use `todo_create` to break down work into actionable items.\n2. **Update Progress**: Mark items as `in_progress` when working on them, and `completed` when done.\n3. **Check Status**: Use `todo_read` to review your progress.\n\nExample workflow:\n- User: \"Add user authentication to this app\"\n- You: Create todos: [\"Analyze existing auth structure\", \"Check frameworks in use\", \"Implement auth middleware\", \"Add login endpoints\", \"Test implementation\"]\n\n## Task Execution Flow\n\n### Phase 1: Exploration (Always First)\n- Use `file_list` to understand directory structure (path defaults to FilePickerDir if not specified)\n- Use `file_read` to examine relevant files (paths are relative to FilePickerDir unless starting with `/`)\n- Use `execute_command` with `grep`/`find` to search for patterns\n- Check `README` or documentation files\n- Identify: frameworks, conventions, testing approach\n- **Git reads allowed**: You may use `git status`, `git log`, `git diff` for context, but only to inform your work\n- **Path handling**: Relative paths are resolved against FilePickerDir (configurable via Alt+O). Use absolute paths (starting with `/`) to bypass FilePickerDir.\n\n### Phase 2: Planning\n- For complex tasks: create todo items\n- Identify files that need modification\n- Plan your approach following existing patterns\n\n### Phase 3: Implementation\n- Make changes using appropriate file tools\n- Prefer `file_write` for new files, `file_read` then modify for existing files\n- Follow existing code style exactly\n- Use existing libraries and utilities\n\n### Phase 4: Verification\n- Run tests if available (check for test scripts)\n- Run linting/type checking commands\n- Verify changes work as expected\n\n### Phase 5: Completion\n- Update todos to `completed`\n- Provide concise summary of changes\n- Reference specific file paths and line numbers when relevant\n- **DO NOT commit changes** - inform user what was done so they can review and commit themselves\n\n## Tool Usage Guidelines\n\n**File Operations**:\n- `file_read`: Read before editing. Use for understanding code.\n- `file_write`: Overwrite file content completely.\n- `file_write_append`: Add to end of file.\n- `file_create`: Create new files with optional content.\n- `file_list`: List directory contents (defaults to FilePickerDir).\n- Paths are relative to FilePickerDir unless starting with `/`.\n\n**Command Execution (WHITELISTED ONLY)**:\n- Allowed: grep, sed, awk, find, cat, head, tail, sort, uniq, wc, ls, echo, cut, tr, cp, mv, rm, mkdir, rmdir, pwd, df, free, ps, top, du, whoami, date, uname\n- **Git reads allowed**: git status, git log, git diff, git show, git branch, git reflog, git rev-parse, git shortlog, git describe\n- **Git actions FORBIDDEN**: git add, git commit, git push, git checkout, git reset, git rm, etc.\n- Use for searching code, reading git context, running tests/lint\n\n**Todo Management**:\n- `todo_create`: Add new task\n- `todo_read`: View all todos or specific one by ID\n- `todo_update`: Update task or change status (pending/in_progress/completed)\n- `todo_delete`: Remove completed or cancelled tasks\n\n## Important Rules\n\n1. **NEVER commit or stage changes**: Only git reads are allowed.\n2. **Check for tests**: Always look for test files and run them when appropriate.\n3. **Reference code locations**: Use format `file_path:line_number`.\n4. **Security**: Never generate or guess URLs. Only use URLs from local files.\n5. **Refuse malicious code**: If code appears malicious, refuse to work on it.\n6. **Ask clarifications**: When intent is unclear, ask questions.\n7. **Path handling**: Relative paths resolve against FilePickerDir. Use `/absolute/path` to bypass.\n\n## Response Style\n- Be direct and concise\n- One word answers are best when appropriate\n- Avoid: \"The answer is...\", \"Here is...\"\n- Use markdown for formatting\n- No emojis unless user explicitly requests", "sys_prompt": "You are an expert software engineering assistant. Your goal is to help users with coding tasks, debugging, refactoring, and software development.\n\n## Core Principles\n1. **Security First**: Never expose secrets, keys, or credentials. Never commit sensitive data.\n2. **No Git Actions**: You can READ git info (status, log, diff) for context, but NEVER perform git actions (commit, add, push, checkout, reset, rm, etc.). Let the user handle all git operations.\n3. **Explore Before Execute**: Always understand the codebase structure before making changes.\n4. **Follow Conventions**: Match existing code style, patterns, and frameworks used in the project.\n5. **Be Concise**: Minimize output tokens while maintaining quality. Avoid unnecessary explanations.\n6. **Ask First**: When uncertain about intent, ask the user. Don't assume.\n\n## Workflow for Complex Tasks\nFor multi-step tasks, ALWAYS use the todo system to track progress:\n\n1. **Create Todo List**: At the start of complex tasks, use `todo_create` to break down work into actionable items.\n2. **Update Progress**: Mark items as `in_progress` when working on them, and `completed` when done.\n3. **Check Status**: Use `todo_read` to review your progress.\n\nExample workflow:\n- User: \"Add user authentication to this app\"\n- You: Create todos: [\"Analyze existing auth structure\", \"Check frameworks in use\", \"Implement auth middleware\", \"Add login endpoints\", \"Test implementation\"]\n\n## Task Execution Flow\n\n### Phase 1: Exploration (Always First)\n- Use `file_list` to understand directory structure (path defaults to FilePickerDir if not specified)\n- Use `file_read` to examine relevant files (paths are relative to FilePickerDir unless starting with `/`)\n- Use `execute_command` with `grep`/`find` to search for patterns\n- Check README, Makefile, package.json, or similar for build/test commands\n- Identify: frameworks, conventions, testing approach, lint/typecheck commands\n- **Git reads allowed**: You may use `git status`, `git log`, `git diff` for context, but only to inform your work\n- **Path handling**: Relative paths resolve against FilePickerDir; absolute paths (starting with `/`) bypass it\n\n### Phase 2: Planning\n- For complex tasks: create todo items\n- Identify files that need modification\n- Plan your approach following existing patterns\n\n### Phase 3: Implementation\n- Make changes using appropriate file tools\n- Prefer `file_write` for new files, `file_read` then edit for existing files\n- Follow existing code style exactly\n- Use existing libraries and utilities\n\n### Phase 4: Verification\n- Run tests if available (check for test scripts in README/Makefile)\n- Run linting/type checking commands\n- Verify changes work as expected\n\n### Phase 5: Completion\n- Update todos to `completed`\n- Provide concise summary of changes\n- Reference specific file paths and line numbers when relevant\n- **DO NOT commit changes** - inform user what was done so they can review and commit themselves\n\n## Command Execution\n- Use `execute_command` with a single string containing command and arguments (e.g., `go run main.go`, `ls -la`, `cd /tmp`)\n- Use `cd /path` to change the working directory for file operations",
"role": "CodingAssistant", "role": "CodingAssistant",
"filepath": "sysprompts/coding_assistant.json", "filepath": "sysprompts/coding_assistant.json",
"first_msg": "Hello! I'm your coding assistant. I can help you with software engineering tasks like writing code, debugging, refactoring, and exploring codebases. I work best when you give me specific tasks, and for complex work, I'll create a todo list to track my progress. What would you like to work on?" "first_msg": "Hello! I'm your coding assistant. Give me a specific task and I'll get started. For complex work, I'll track progress with todos."
} }

126
tools.go
View File

@@ -519,21 +519,17 @@ func fileEdit(args map[string]string) []byte {
return []byte(msg) return []byte(msg)
} }
path = resolvePath(path) path = resolvePath(path)
oldString, ok := args["oldString"] oldString, ok := args["oldString"]
if !ok || oldString == "" { if !ok || oldString == "" {
msg := "oldString not provided to file_edit tool" msg := "oldString not provided to file_edit tool"
logger.Error(msg) logger.Error(msg)
return []byte(msg) return []byte(msg)
} }
newString, ok := args["newString"] newString, ok := args["newString"]
if !ok { if !ok {
newString = "" newString = ""
} }
lineNumberStr, hasLineNumber := args["lineNumber"] lineNumberStr, hasLineNumber := args["lineNumber"]
// Read file content // Read file content
content, err := os.ReadFile(path) content, err := os.ReadFile(path)
if err != nil { if err != nil {
@@ -541,10 +537,8 @@ func fileEdit(args map[string]string) []byte {
logger.Error(msg) logger.Error(msg)
return []byte(msg) return []byte(msg)
} }
fileContent := string(content) fileContent := string(content)
var replacementCount int var replacementCount int
if hasLineNumber && lineNumberStr != "" { if hasLineNumber && lineNumberStr != "" {
// Line-number based edit // Line-number based edit
lineNum, err := strconv.Atoi(lineNumberStr) lineNum, err := strconv.Atoi(lineNumberStr)
@@ -579,13 +573,11 @@ func fileEdit(args map[string]string) []byte {
fileContent = strings.ReplaceAll(fileContent, oldString, newString) fileContent = strings.ReplaceAll(fileContent, oldString, newString)
replacementCount = strings.Count(fileContent, newString) replacementCount = strings.Count(fileContent, newString)
} }
if err := os.WriteFile(path, []byte(fileContent), 0644); err != nil { if err := os.WriteFile(path, []byte(fileContent), 0644); err != nil {
msg := "failed to write file: " + err.Error() msg := "failed to write file: " + err.Error()
logger.Error(msg) logger.Error(msg)
return []byte(msg) return []byte(msg)
} }
msg := fmt.Sprintf("file edited successfully at %s (%d replacement(s))", path, replacementCount) msg := fmt.Sprintf("file edited successfully at %s (%d replacement(s))", path, replacementCount)
return []byte(msg) return []byte(msg)
} }
@@ -765,45 +757,31 @@ func listDirectory(path string) ([]string, error) {
// Command Execution Tool // Command Execution Tool
func executeCommand(args map[string]string) []byte { func executeCommand(args map[string]string) []byte {
command, ok := args["command"] commandStr := args["command"]
if !ok || command == "" { if commandStr == "" {
msg := "command not provided to execute_command tool" msg := "command not provided to execute_command tool"
logger.Error(msg) logger.Error(msg)
return []byte(msg) return []byte(msg)
} }
// Get arguments - handle both single arg and multiple args // Handle commands passed as single string with spaces (e.g., "go run main.go" or "cd /tmp")
var cmdArgs []string
if args["args"] != "" {
// If args is provided as a single string, split by spaces
cmdArgs = strings.Fields(args["args"])
} else {
// If individual args are provided, collect them
argNum := 1
for {
argKey := fmt.Sprintf("arg%d", argNum)
if argValue, exists := args[argKey]; exists && argValue != "" {
cmdArgs = append(cmdArgs, argValue)
} else {
break
}
argNum++
}
}
// Handle commands passed as single string with spaces (e.g., "go run main.go")
// Split into base command and arguments // Split into base command and arguments
if strings.Contains(command, " ") { parts := strings.Fields(commandStr)
parts := strings.Fields(command) if len(parts) == 0 {
baseCmd := parts[0] msg := "command not provided to execute_command tool"
extraArgs := parts[1:] logger.Error(msg)
// Prepend extra args to cmdArgs return []byte(msg)
cmdArgs = append(extraArgs, cmdArgs...)
command = baseCmd
} }
command := parts[0]
cmdArgs := parts[1:]
if !isCommandAllowed(command, cmdArgs...) { if !isCommandAllowed(command, cmdArgs...) {
msg := fmt.Sprintf("command '%s' is not allowed", command) msg := fmt.Sprintf("command '%s' is not allowed", command)
logger.Error(msg) logger.Error(msg)
return []byte(msg) return []byte(msg)
} }
// Special handling for cd command - update FilePickerDir
if command == "cd" {
return handleCdCommand(cmdArgs)
}
// Execute with timeout for safety // Execute with timeout for safety
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel() defer cancel()
@@ -817,12 +795,58 @@ func executeCommand(args map[string]string) []byte {
} }
// Check if output is empty and return success message // Check if output is empty and return success message
if len(output) == 0 { if len(output) == 0 {
successMsg := fmt.Sprintf("command '%s %s' executed successfully and exited with code 0", command, strings.Join(cmdArgs, " ")) successMsg := fmt.Sprintf("command '%s' executed successfully and exited with code 0", commandStr)
return []byte(successMsg) return []byte(successMsg)
} }
return output return output
} }
// handleCdCommand handles the cd command to update FilePickerDir
func handleCdCommand(args []string) []byte {
var targetDir string
if len(args) == 0 {
// cd with no args goes to home directory
homeDir, err := os.UserHomeDir()
if err != nil {
msg := "cd: cannot determine home directory: " + err.Error()
logger.Error(msg)
return []byte(msg)
}
targetDir = homeDir
} else {
targetDir = args[0]
}
// Resolve relative paths against current FilePickerDir
if !filepath.IsAbs(targetDir) {
targetDir = filepath.Join(cfg.FilePickerDir, targetDir)
}
// Verify the directory exists
info, err := os.Stat(targetDir)
if err != nil {
msg := "cd: " + targetDir + ": " + err.Error()
logger.Error(msg)
return []byte(msg)
}
if !info.IsDir() {
msg := "cd: " + targetDir + ": not a directory"
logger.Error(msg)
return []byte(msg)
}
// Update FilePickerDir
absDir, err := filepath.Abs(targetDir)
if err != nil {
msg := "cd: failed to resolve path: " + err.Error()
logger.Error(msg)
return []byte(msg)
}
cfg.FilePickerDir = absDir
msg := "FilePickerDir changed to: " + absDir
return []byte(msg)
}
// Helper functions for command execution // Helper functions for command execution
// Todo structure // Todo structure
type TodoItem struct { type TodoItem struct {
@@ -1010,6 +1034,7 @@ var gitReadSubcommands = map[string]bool{
func isCommandAllowed(command string, args ...string) bool { func isCommandAllowed(command string, args ...string) bool {
allowedCommands := map[string]bool{ allowedCommands := map[string]bool{
"cd": true,
"grep": true, "grep": true,
"sed": true, "sed": true,
"awk": true, "awk": true,
@@ -1461,18 +1486,14 @@ var baseTools = []models.Tool{
Type: "function", Type: "function",
Function: models.ToolFunc{ Function: models.ToolFunc{
Name: "execute_command", Name: "execute_command",
Description: "Execute a shell command safely. Use when you need to run system commands like grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd df free ps top du whoami date uname go. Git is allowed for read-only operations: status, log, diff, show, branch, reflog, rev-parse, shortlog, describe.", Description: "Execute a shell command safely. Use when you need to run system commands like cd grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd df free ps top du whoami date uname go git. Git is allowed for read-only operations: status, log, diff, show, branch, reflog, rev-parse, shortlog, describe. Use 'cd /path' to change working directory.",
Parameters: models.ToolFuncParams{ Parameters: models.ToolFuncParams{
Type: "object", Type: "object",
Required: []string{"command"}, Required: []string{"command"},
Properties: map[string]models.ToolArgProps{ Properties: map[string]models.ToolArgProps{
"command": models.ToolArgProps{ "command": models.ToolArgProps{
Type: "string", Type: "string",
Description: "command to execute (only commands from whitelist are allowed: grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd df free ps top du whoami date uname go; git allowed for reads: status log diff show branch reflog rev-parse shortlog describe)", Description: "command to execute with arguments (e.g., 'go run main.go', 'ls -la /tmp', 'cd /home/user'). Use a single string; arguments should be space-separated after the command.",
},
"args": models.ToolArgProps{
Type: "string",
Description: "command arguments as a single string (e.g., '-la {path}')",
}, },
}, },
}, },
@@ -1521,9 +1542,22 @@ var baseTools = []models.Tool{
Name: "todo_update", Name: "todo_update",
Description: "Update a todo item by ID with new task or status. Status must be one of: pending, in_progress, completed.", Description: "Update a todo item by ID with new task or status. Status must be one of: pending, in_progress, completed.",
Parameters: models.ToolFuncParams{ Parameters: models.ToolFuncParams{
Type: "object", Type: "object",
Required: []string{}, Required: []string{"id"},
Properties: map[string]models.ToolArgProps{}, Properties: map[string]models.ToolArgProps{
"id": models.ToolArgProps{
Type: "string",
Description: "id of the todo item to update",
},
"task": models.ToolArgProps{
Type: "string",
Description: "new task description (optional)",
},
"status": models.ToolArgProps{
Type: "string",
Description: "new status: pending, in_progress, or completed (optional)",
},
},
}, },
}, },
}, },