BashSchema is the OpenAI tool definition for bash, exposed by every profile.
()
| 97 | |
| 98 | // BashSchema is the OpenAI tool definition for bash, exposed by every profile. |
| 99 | func BashSchema() map[string]any { |
| 100 | return map[string]any{ |
| 101 | "type": "function", |
| 102 | "function": map[string]any{ |
| 103 | "name": BashName, |
| 104 | "description": "Run a shell command in the user's environment. Combined stdout+stderr is returned. Use targeted commands (grep, head, tail) to avoid the 6k truncation.", |
| 105 | "parameters": map[string]any{ |
| 106 | "type": "object", |
| 107 | "properties": map[string]any{ |
| 108 | "cmd": map[string]any{ |
| 109 | "type": "string", |
| 110 | "description": "The shell command to execute.", |
| 111 | }, |
| 112 | "timeout_seconds": map[string]any{ |
| 113 | "type": "integer", |
| 114 | "description": "Optional per call timeout in seconds. Default 120, hard capped at 3600. Raise for commands you expect to run long (pytest on large suites, docker build, DB migrations).", |
| 115 | }, |
| 116 | }, |
| 117 | "required": []string{"cmd"}, |
| 118 | }, |
| 119 | }, |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | // Execute runs a tool call and returns the (possibly truncated) result ready |
| 124 | // to be appended to the conversation as a `tool` message. |